Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

have a relative shebang line

I'm writing a rails app and need to run come scripts through ./script/runner

while i could put

#!/home/cannon/src/timetracker/script/runner 

at the top, that wont work in production where it needs to be more like

#!/var/www/loclahost/htdocs/timetracker/script/runner -e=production

since ./script is not in my path, and I don't want it to be, how can I allow this to be set up,

I am using a cron job to run it on a Linux box

like image 999
loosecannon Avatar asked Jan 19 '23 09:01

loosecannon


1 Answers

Use env in the shebang line to look things up in the path:

#!/usr/bin/env ./script/runner
like image 74
Josh Lee Avatar answered Jan 28 '23 13:01

Josh Lee