What the below command does? echo var=$<
-
Assigns value of < to var variable
- Assigns value of $< to var variable
-
Gets input from stdin and assigns that to var variable
-
Assigns previously returned value to var variable
In traditional Bourne-like shells or specific shell scripts, < is not a standard variable. However, in the context of some older shells or specific scripting languages (like Perl or C shell variants), $< is used to read a line from standard input.
To explain the given command, let's break it down:
echo var=$<
This command is using the echo command to print a string. The string being printed is var= followed by $<.
In shell scripting, the $< represents the input from standard input (stdin). It is used to read input from the user or from a file.
So, the correct answer is:
C. Gets input from stdin and assigns that to the var variable