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?
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...
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...
What would these commands look like in Kali Linux? In Kali Linux: a) Create a user...
What would these commands look like in Kali Linux? In Kali Linux: a) Create a user (username= YOUR-FIRSTNAME). b) Create a file (filename=test) and use chmod command to add the write permission for Others. c) Use setfacl to remove write permission to YOUR-FIRSTNAME user. Use getfacl to check the file's permissions. d) Remove YOUR-FIRSTNAME user. Deliverable(Screenshots from each section if possible please)
What are the UNIX commands for each of these steps? 1. Copy all of the files...
What are the UNIX commands for each of these steps? 1. Copy all of the files in your Files directory to the Backup directory. 2. Create an ITE130 directory in the Classes Directory 3. Move all the ITE 130 files from the backup directory to the ITE130 directory. 4. Redirect echo step 19 to mark this step in the lab3.txt file 5. Display all of the directories and sub-directories including files so I can verify you completed all the above...
What are the UNIX commands for each of these steps? 1. Delete all the files in...
What are the UNIX commands for each of these steps? 1. Delete all the files in the Classes and Backup directories only. 2. Redirect echo step 23 to mark this step in the lab3.txt file 3. Display all of the directories and sub-directories including files so I can verify you completed all the steps correctly. 4. Repeat the above step and redirect the output to the file lab3.txt without erasing what is already in it! 5. Redirect echo step 26...
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT