In AIX, I tried to redirect both STDERR & STDOUT to /dev/null but the redirection doesn’t seems to be happening. What might be the problem?
bash-3.2# /usr/sbin/lsgroup Test-Group | grep kbxb025 > /dev/null 2>&1
Group "Test-Group" does not exist.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Redirections refer to commands, not whole pipelines. The outputs of
grepgo into/dev/null, but not those oflsgroup. To solve these issues, group the pipeline into a subshell: