pbs - redirecting error messages in a bash script -


i'm using server pbs. i'm testing with

echo sleep 10 | qsub 

at moment there problem server , error message returned. redirecting error message

echo sleep 10 | qsub 2>&1 

nothing printed.

now put shell script , save output in variable:

out=`echo sleep 10 | qsub 2>&1` 

however, although i'm redirecting error message using 2>&1, variable out still contains error message. doing wrong?

2>&1 - redirects stderr stdout

what you're after 2>/dev/null

out=`echo sleep 10 | qsub 2>/dev/null` 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -