Thursday, January 14, 2010

Send Capshell Commands in Single Command-line

You can echo multiple lines and pipe them into capshell like:
echo "some command 1" "some command 2" | capshell
That starts capshell and runs some command 1 and then some command 2. Simple, but I thought it was neat, especially if you just want to create an alias to check for something via a short command line like:
alias e=cd /path/to/rails/project && echo "with appservers" "grep -r some_text /path/on/server/to/app/current/log" | capshell
then at command line you just type 'e' and it will grep all app server logs for some_text.

For more info about capshell, see Capistrano.

No comments: