Question

- What is the outcome when we run the following commands? $ exec 5>/tmp/xyz $ echo...

- What is the outcome when we run the following commands?

$ exec 5>/tmp/xyz

$ echo hello >&5

Homework Answers

Answer #1

$ exec 5>/tmp/xyz : This line will open the file with location "/tmp/xyz" having filename as "xyz" using file descriptor 5. In other words the integer 5 is used as an indicator to access the file xyz. It can be also said that this comman will open the file xyz with FD 5.

$ echo hello >&5 : The command echo is basically used to output some string. Here, the string hello is printed along with >&5. This indicates that inside the file pointed by FD 5, the corresponding string will be written. In other words, hello will be written to the file pointed by FD 5.

CONCLUSION: Both the commands together will open the file located at "/tmp/" having a name "xyz" (using file descriptor 5, FD 5) and write (or print) "hello" in the file.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Explain what we mean by echo in spin echo imaging and explain how an echo is...
Explain what we mean by echo in spin echo imaging and explain how an echo is generated
Why do you think we can hear our voices echo when we are in a place...
Why do you think we can hear our voices echo when we are in a place like a gym or canyon? Explain.
When we open Command Prompt with elevated rights (as an Administrator), except if we use the...
When we open Command Prompt with elevated rights (as an Administrator), except if we use the File Explorer in a particular directory, we are normally at this directory. Group of answer choices C:\Windows\System32 C:\Users\Username\Desktop C:\Windows C:\Users\Username The following commands are some of the ways to view the username of the current users, except: SET ECHO whoami WHOAMI ECHO %username% We can find out the BIOS version, OS Name, System Type, and other system related information with this tool: Group of...
There are two possible outcomes about the economy next year. We will have outcome A if...
There are two possible outcomes about the economy next year. We will have outcome A if there is a small increase in AD. We will have outcome B if there is a large increase in AD. Comparing the two outcomes, inflation in outcome A is ________ than that in outcome B; unemployment in outcome A is ________ than that in outcome B. higher; lower higher; higher lower; higher lower; lower Which of the following statements is incorrect? The LRPC shifts...
What are the UNIX commands for each of these steps? 1. Copy all the files from...
What are the UNIX commands for each of these steps? 1. Copy all the files from the Files directory in my user account (user305) to your Files directory 2. Redirect echo step 11 to mark this step in the lab3.txt file 3. Display the directories and sub-directories including files so I can verify all the files were copied. 4. Redirect the above step to the lab3.txt file 5.. Copy only the following files from your Files directory to the Classes...
user1 and user2 are both members in group gr1. Assume user1 run the following commands: $...
user1 and user2 are both members in group gr1. Assume user1 run the following commands: $ who am i user1 pts/7 Oct 20 10:02 $ ls -ld /home/user2/info drwx-----x. 2 user2 gr1 4096 09-20 09:31 /home/user2/info $ ls -l /home/user2/info ls: /home/user2/info: Permission denied Explain why user1 got permission denied?
It is most important to distinguish between the short run and the long run when we...
It is most important to distinguish between the short run and the long run when we are discussing aggregate supply. aggregate expenditures. money demand. aggregate demand.
a) What 4 outcomes will a binding minimum wage have, and what 1 outcome has 2...
a) What 4 outcomes will a binding minimum wage have, and what 1 outcome has 2 possibilities. b) When is a perfectly competitive firm in the short run? What 3 outcomes can a firm face in the short run, and what would be each result moving into the long run?
Which of the following would not be considered a stop word? At We Output These A...
Which of the following would not be considered a stop word? At We Output These A Python program can work with which of the following values? Numbers Strings of characters Booleans All of the above 3. Which of the following would be described as a “float” in Python? True 140 14.0 ‘rootbeer’ 4. Which of the following strings has been written correctly? “Hello World! Hello World! ‘Hello World!” ‘Hello World!’ 5. What would be the result of 8 % 4...
What does the following script do? #!/bin/bash echo $(ls|grep -E "*\.$1$"|wc -l)
What does the following script do? #!/bin/bash echo $(ls|grep -E "*\.$1$"|wc -l)
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT