I am trying to gather all of my TODOs and make one file out of them.
#!/bin/bash
# Script for getting all TODOS
PATH="~/documents/obsidian-notes/"
OUTPUT="/home/fish/documents/obsidian-notes/TODO.md"
echo "#TODO" > $OUTPUT
grep -hr --exclude-dir=plugins "\bTODO\b:.*" $PATH | awk '{print $0,"\n"}' >> $OUTPUT
If I run each line in my prompt it works perfectly. When I add them to a script and make it executable and run it I get
./obtodo.sh: line 10: grep: command not found
./obtodo.sh: line 10: awk: command not found
./obtodo.sh: line 12: chown: command not found
I tried running as sudo and I made the script executable with chmod a+x