MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

UNIX

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
To Display line of text/string that are passed as an argument with a command
A
cat
B
echo
C
ls
D
none of the above
Explanation: 

Detailed explanation-1: -Echo is a Unix/Linux command tool used for displaying lines of text or string which are passed as arguments on the command line. This is one of the basic command in linux and most commonly used in shell scripts.

Detailed explanation-2: -echo command in linux is used to display line of text/string that are passed as an argument . This is a built in command that is mostly used in shell scripts and batch files to output status text to the screen or a file.

Detailed explanation-3: -$? Expands to the exit status of the most recently executed foreground pipeline. echo $? will return the exit status of last command. You got 127 that is the exit status of last executed command exited with some error (most probably).

Detailed explanation-4: -For example, if you echo “hello” to a file then calculate the md5, the value will be different from direct calculate md5("hello") . You can see when use echo-n then use cat to show the file content, it will display an extra “%” to indicate that there is no “newline character".

There is 1 question to complete.