Posted by guptaradhesh on July 27, 2012
One would frequently notice this training redirect construct in many Unix commands – all it means is, ALL output from this command should be pushed into /dev/null.
> /dev/null 2>&1
/dev/null is a place where we can dump anything we don’t want to use. Since, 1 is stdout and 2 is stderr: 2>&1 can be interpreted as redirect stderr to stdout. Thus, Error messages which go to stderr are redirected to stdout which is being redirected to dev/null. Therefore, no output at all.
Posted in tech, unix | Tagged: /dev/null, 2>&1, bash, stderr, stdout, unix | Leave a Comment »
Posted by guptaradhesh on October 24, 2010
$# Number of positional parameters
$? Exit value of last executed command
$$ Process number of current process
$! Process number of background process
$* All arguments on command line
“$@” All arguments on command line , individually quoted “$1” “$2” …
$- Options currently in effect
Posted in tech | Tagged: bash, shell, special parameters, unix | Leave a Comment »