What output will be displayed when the user fred executes the following command?
echo ‘fred $USER’
A. fred fred
B. fred /home/fred/
C. ‘fred $USER’
D. fred $USER
E. ‘fred fred’
What output will be displayed when the user fred executes the following command?
echo ‘fred $USER’
A. fred fred
B. fred /home/fred/
C. ‘fred $USER’
D. fred $USER
E. ‘fred fred’
Text within single quotes is not changed by the shell. So all special characters contained in it lose their special meaning. Variables are not replaced by their value.
Within quotation marks, all special characters except $ lose their special meaning. Shell or environment variables that occur within these characters are therefore replaced by their value.
D is correct.
don’t copy that text and paste to your terminal.
Just type yourself
why D??? i think E
echo ‘root $USER’
‘root root’