2010-06-23 11 views
0

J'ai créé un script shell dans mon dossier lib.RAILS_ROOT avec script shell

Et je veux utiliser RAILS_ROOT dans ce script au lieu du long chemin.

Est-il possible que je peux le faire?

Ce que mon script

if ! [ -s delayed_job.pids ]; then 
    RAILS_ENV=production /home/app/script/delayed_job start 
fi 

Je veux cette ligne avec quelque chose comme modifié qui.

if ! [ -s delayed_job.pids ]; then 
    RAILS_ENV=production #{RAILS_ROOT}/script/delayed_job start 
fi 

Est-ce possible? Comment ?

Répondre

1
run_result = `#{Rails.root}/lib/your_script_name.sh` 
# ` is backtick character in upper left corner of your keyboard below ESC