I have a program 'myprog' in ~/bin. I want to run this from cron with a nice setting so I call it like so:
This results in the following message
I have no problem running myprog without nice or when specifying a complete path to myprog (using ~ or $HOME), but `nice` isn't able to find myprog without either $PATH being fully expanded (i.e. PATH=/Users/me/bin instead of ~/bin or $HOME/bin) or myprog being fully qualified when called by nice (ex. nice ~/bin/myprog).
I don't have access to another OS now, but I thought this was weird. I know it seems trivial, especially since I can work around it, but it bugs me. I've even checked the POSIX spec and don't see anything wrong with what I am trying. Is this odd behavior limited to OS X?
Code:
PATH=~/bin:/usr/bin
*/1 * * * * nice -n 15 myprog
Code:
...
X-Cron-Env: <PATH=~/bin:/usr/bin>
X-Cron-Env: <SHELL=/bin/sh>
...
X-Cron-Env: <HOME=/Users/me>
...
nice: myprog: No such file or directory
I don't have access to another OS now, but I thought this was weird. I know it seems trivial, especially since I can work around it, but it bugs me. I've even checked the POSIX spec and don't see anything wrong with what I am trying. Is this odd behavior limited to OS X?