No such directory error calling lynx in a shell script

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”`

Tags: ,

3 Responses to “No such directory error calling lynx in a shell script”

  1. Glauco says:

    Thank you so much. This article has helped me.

  2. admin says:

    Dear Glauco, de nada , I’m happy to know it has been useful for You. 🙂

  3. noryungi says:

    Thanks so much! I have been slaving away at a Nagios script for two days before finding this!

Leave a Reply