Tag Archives: Shell scripting Interview questions

What Does echo 1>&2 mean

1 – stdout
2 – stderr

This means redirect echo’s output to stderr, with a message on how to use the script,
there needs to be exactly three arguments.

All error conditions should go to stderr.

Leave a comment

Posted by on December 8, 2012 in Uncategorized


Tags: ,

Shell scripting Interview questions

Hey Guys n Gals,

I m back after a long time, work work work…..I have started to write small articles help full to others and this one is shell scripting interview questions.

So here goes

This was asked at Capgemini

How will you save the output of the TOP command in a file?

Use  Top in batch mode

# top -b -n1 > filename.txt

The -b option is for batch mode and the -n option is for the number of iterations in this case 1.

You can use the -d to option to to specify the time between two iterations

# top -b -n1 -d10 > filename.txt

The delay is 10 seconds


Tags: , ,

%d bloggers like this: