Question

In: Computer Science

Unix / Linux 31. Given the first two commands, what is the expected output for the...

Unix / Linux

31.

Given the first two commands, what is the expected output for the third command? (single quotes)

$ echo *

a b c

$ x=*

$ echo '$x'

32.

Given the first two commands, what is the expected output for the third command? (Single quotes inside of double quotes)

$ echo *

a b c

$ x=*

$ echo "'$x'"

33.

Given the first two commands, what is the expected output for the third command? (double quotes inside of single quotes)

$ echo *

a b c

$ x=*

$ echo '"$x"'

34.

Given the first two commands, what is the expected output for the third command? (double quotes)

$ echo *

a b c

$ x=*

$ echo "$x"

35.

Given the first two commands, what is the expected output for the third command? (no quotes)

$ echo *

a b c

$ x=*

$ echo $x

Solutions

Expert Solution

31.

$ x=*

$ echo '$x'

OUTPUT: $x

whatever you write with in the single quotes, it is consider as a text to display. so the output is $x

32.

$ x=*

$ echo "'$x'"

OUTPUT: '*'

in double quotes, text and symbols are normally displayed but commands starts with $ are executed. here $ is a command used to display the variable value. here the variable is x. $x means * so, the value * is printed on the output screen. single quotes are normally displayed because they are not commands to execute.

33.

$ x=*

$ echo '"$x"'

OUTPUT: "$x"

In sigle quotes, every character and symbol is treated as text, they are not considered as commands. so everything written in single quotes is displayed on the output screen.

34.

$ x=*

$ echo "$x"

OUTPUT: *

Double quotes can execute the commands which are written inside it. here $x is a command. so it is executed and displayed the value of x to output console.

35.

$ x=*

$ echo $x

OUTPUT: *

you can display the variable value in unix without any quotes or by using double quotes. $x is a command to display the value of the x to output console. so * is printed on the output screen.


Related Solutions

Unix/Linux Turn in the following commands and any output from the commands. 1) ll to show the original 3 files
Unix/LinuxTurn in the following commands and any output from the commands.1) ll to show the original 3 files2) run the tar command to stuff three files3) ll to show the 'tar archive'4) mkdir newdir to create a new directory to unstuff the 'tar archive'
Objective: Practice common UNIX commands. Procedure: The following list of Unix commands are given for self-learning....
Objective: Practice common UNIX commands. Procedure: The following list of Unix commands are given for self-learning. Use 'whatis' or 'man' command to find out about each command. Your document should include the description or screen shots of the output from each of the command. Commands: df du gzip file history wget Changing access rights: chmod u+x Dir1.0             adds execute permission for the owner chmod go-w file1               removes write permission for the group and others chmod ugo=rw testfile      sets...
QUESTION 1 Match the following LINUX/UNIX commands with what they do. du    whereis users who...
QUESTION 1 Match the following LINUX/UNIX commands with what they do. du    whereis users who am i A. display a compact list of users currently logged in B. locate the binary, source, and manual page files for a command C. summarize disk usage D. who am i currently logged in as on the Linux server. QUESTION 2 What rm command option (flag) would you use to remove a file that begins with a - (hyphen)? -f -p --   ...
What are control structures in Linux/Unix?
What are control structures in Linux/Unix?
please use linux or unix to complete, and include pictures of the output. Modify the code...
please use linux or unix to complete, and include pictures of the output. Modify the code below to implement the program that will sum up 1000 numbers using 5 threads. 1st thread will sum up numbers from 1-200 2nd thread will sum up numbers from 201 - 400 ... 5th thread will sum up numbers from 801 - 1000 Make main thread wait for other threads to finish execution and sum up all the results. Display the total to the...
Linux-Practise1: Run the following commands (Print working directory) pwd. What is the output of the above...
Linux-Practise1: Run the following commands (Print working directory) pwd. What is the output of the above command Create a file named Linux1 nano Linux1 Type the following in the file Hello world Save the file Create a copy of the file cp Linux1 Linux2 view the listing of the files in the directory            ls What is the output of the above command rename the file mv Linux2 Linux3 view the listing of the files in the directory            ls...
Unix / Linux 16. Regular Expression: Given the following regular expression, provide a description of the...
Unix / Linux 16. Regular Expression: Given the following regular expression, provide a description of the intended match. ^[^A-Z] 17. Regular Expression: Given the following regular expression, provide a description of the intended match. [^^!] 18. Regular Expression: Given the following regular expression, provide a description of the intended match. ^.\{72\}$ 19. Regular Expression: Given the following regular expression, provide a description of the intended match. [A-Za-z0-9] 20. Regular Expression: Given the following regular expression, provide a description of the...
what is the major change of Unix, Linux and Android. what there evelution ? what they occor? discuss this
what is the major change of Unix, Linux and Android. what there evelution ? what they occor? discuss this
Unix / Linux 21. Given the following command pipeline, provide a diagram (ascii art) or detailed...
Unix / Linux 21. Given the following command pipeline, provide a diagram (ascii art) or detailed description indicating all the Input/Output (I/O) connections. Every stdin, stdout, and stderr for each command will need to connect to something. grep a < words | wc -l > a_count.txt 22. Explain what is wrong (if anything) with the following command pipeline. cd | ls 23. Stream Editor: Write a sed command to delete digits, but only on lines that end with a period....
Unix / Linux 6. vi editor: In vi command mode, what are the keystrokes you would...
Unix / Linux 6. vi editor: In vi command mode, what are the keystrokes you would type to... Quit the vi editor and save any changes? 7. C language source files, by convention, have the suffix ".c". The associated "header" files have the suffix ".h". What is the command to perform the following task: List all the C source and C header files in the current directory. [Hidden files may remain hidden.] 8. C language source files, by convention, have...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT