Posts Tagged ‘lynx’

No such directory error calling lynx in a shell script

Monday, June 14th, 2010

Some time ago I was testing a shell script nagios plugin. Running this script from command line was ok, but once called from nagios scheduling, the plugin standard error was

/root/: No such directory

Due to some little problem (is this a lynx problem?)  I needed to set the HOME environment variable before calling lynx.

MYSTR=`export HOME=/tmp && /usr/bin/lynx -dump “http://$MYHOST/$MYURL?MYFILTER=$MYPARAM”`