I am having a really hard time hiding console messages from my shells (ksh) script which I run in the background.
I have tried moving it to /dev/null but it doesn’t seem to be working. Here is the line in the script:
pid=`/usr/local/bin/lsof | grep 16752 | grep LISTEN |awk '{print $2}'` > /dev/null 2>&1
Example after I have kicked off the script:
$ lsof: WARNING: /home2/s499929/.lsof_ktazd2250 was updated.
lsof: WARNING: /home2/s499929/.lsof_ktazd2250 was updated.
lsof: WARNING: /home2/s499929/.lsof_ktazd2250 was updated.
lsof: WARNING: /home2/s499929/.lsof_ktazd2250 was updated.
lsof: WARNING: /home2/s499929/.lsof_ktazd2250 was updated.
lsof: WARNING: /home2/s499929/.lsof_ktazd2250 was updated.
lsof: WARNING: /home2/s499929/.lsof_ktazd2250 was updated.
lsof: WARNING: /home2/s499929/.lsof_ktazd2250 was updated.
lsof: WARNING: /home2/s499929/.lsof_ktazd2250 was updated.
lsof: WARNING: /home2/s499929/.lsof_ktazd2250 was updated.
$ ls -lsof: WARNING: /home2/s499929/.lsof_ktazd2250 was updated.
Any ideas on what I am missing?
/usr/local/bin/lsof 2>/dev/null | grep 16752 | grep LISTEN |awk '{print $2}'