but it doesn't work...
i think the reason is that it skips file globbing, and considers *.sh to be a file, that (of course) can't be found! How can i make file globbing and double quotes coexist? in other words how can i make this example work?
thanks in advance for your time,
nicolas
PS: in quoting as a reference i use chap7 from "learning the bash shell 3rd edition" but i am relatively new to shell scripting.Is there any other good reference for bash?
directory="~/project-dir"
cd $directory && rm -f tags && find . -name "*.sh" | xargs ctags -a
The xargs command takes the output from find, and runs the ctags command as many times as needed (not once for each file, but as many times as required if the command line cannot hold all the arguments on one line). The -a command ensures ctags appends to the existing tags file in case xargs does need more than one call.