Let’s suppose I have a bash script (foo.sh) that in a very simplified form, looks like the following: echo “hello” sleep 100 & ps ax | grep sleep | grep -v grep | awk ‘{ print $1 } ‘ | xargs kill -9 echo “bye” The third line imitates pkill, which I don’t have by […]
Category: bash
Ruby on Rails: How can I specify runner script environment
I am using a shell script to run some runner scripts in my Ruby on Rails app. I need to run it on the production database, but the following: #!/bin/bash /usr/bin/ruby RAILS_ENV=production ../script/runner ../lib/tasks.rb gives an error: /usr/bin/ruby: No such file or directory — RAILS_ENV=production (LoadError) I have tried to force it in config/environment.rb ENV[‘RAILS_ENV’] […]