I need to suppress the error message for commands. I have given the command like below
lsb_release -dr 2>/dev/null
But it is not working.
Am testing with Red Hat Linux release 9. Guide me.
Thanks in advance
I need to suppress the error message for commands. I have given the command like below
lsb_release -dr 2>/dev/null
But it is not working.
Am testing with Red Hat Linux release 9. Guide me.
Thanks in advance
what does this show?
strace -e=open,dup,dup2 lsb_release
It could be that something is causing stderr to be other than file descriptor 2. I'm assuming you did not previously redirect stderr with exec:
exec 2>&4
If you're using a raw console, it may be these are messages from the system logger and not merely printed by your process.