I have a professor who stores homework assignments in many files spread across different sub-directories in a lecture folder with the header "TODO:" I'd like to output all these todo's to a single text file in nano instead of navigating from one assignment file to another.
I tried to make an alias for this command, since I use it so much, but whenever I try to execute it, the cursor just blinks and nothing happens.
alias todo='cd /home/csc103/Desktop/shared/csc103-lectures && grep -Rw "TODO:" --after-context=6 --include="*.cpp" . > todo.txt && nano todo.txt'
What am I doing wrong here?
Edit
by "Nothing Happens" I mean that the cursor keeps blinking and the next prompt doesn't come up. As in the left terminal pane in the image below.
However, when I force-quit the process with ctrl-C I do end up in the directory I wanted the todo command alias to take me to. And there is a todo.txt file in there.
Also, if it's of any relevance I'm issuing these commands on an Arch Linux install in VirtualBox.
grep
didn't find anything, so it returned a nonzero exit status which means the last&&
skipped yournano
invocation.todo.txt
fle created? What’s in it? Are you saying that this exact same command works when you type it, but not when you run it via an alias? Please do not respond in comments; edit your question to make it clearer and more complete.