Computer Science Fundamentals Operating Systems Objective
Mar 10, 2013

How many number of errors in this shell script

echo How are you?
read $answer

Choose the correct answer:
B) 1
C) 2
D) 3
Detailed Explanation

There are two errors in this script. First is the ? . It is a meta character. So. when the shell encounters ? , it will try for a match, with the files in the current directory. made up of just one character. Use ? , to suppress the special meaning of ? . $answer means the value of the variable answer. Since you are reading the value of the variable answer, it should he read answer.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback