bash - Redirect output from a shell script to a file -


i'm busy writing capistrano deployment script 1 of our applications. 1 of steps installs rvm using following command:

run "cat ~/rvm-installer.sh | bash -s stable --ruby" 

however, feel output verbose, , rather want dump .log file. possible redirect output entire rvm-installer.sh script elsewhere?

like this:

run "cat ~/rvm-installer.sh | bash -s stable --ruby >out.log" 

or, if want redirect standard error stream of process well:

run "cat ~/rvm-installer.sh | bash -s stable --ruby >out.log 2>err.log" 

you can redirect same file:

run "cat ~/rvm-installer.sh | bash -s stable --ruby >out.log 2>&1" 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -