Linux OS Shell Question:
Download Questions PDF

Which of these is not a valid variable in bash:
a) __ (double underscore)
b) _1var (underscore 1 var )
c) _var_ (underscore var underscore)
d) some-var (some hyphen var)

Answer:

d) some-var (some hyphen var)

Download Linux Shell Interview Questions And Answers PDF

Previous QuestionNext Question
What is the return value ($?) of this code:

os = Unix
[$osName = UnixName] && exit 2
[${os}Name = UnixName] && exit 3

a) 0
b) 1
c) 2
d) 3
How do you print the lines between 5 and 10, both inclusive?
a) cat filename | head | tail -6
b) cat filename | head | tail -5
c) cat filename | tail +5 | head
d) cat filename | tail -5 | head -10