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?
When comparing means among three independent samples, will we obtain the same results if we run...
When comparing means among three independent samples, will we obtain the same results if we run a series of independent t-tests (for pairwise mean comparisons) as those from the one-way ANOVA? Why or why not? Explain why you believe so.
Why do we run post hocs when calculating an ANOVA that is significant, but not for...
Why do we run post hocs when calculating an ANOVA that is significant, but not for a T-test that is significant (be sure to discuss both parts of the question to get full points)?
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT
Active Questions
  • The blade in a food processor spins at 1700 rpm. After the machine is turned off,...
    asked 4 minutes ago
  • Partial-Year Depreciation Equipment acquired at a cost of $93,000 has an estimated residual value of $6,000...
    asked 6 minutes ago
  • Which of the following polypeptides is most likely to form an alpha helix? Explain? a) Cys-Arg-Ala-Gly-Asn-Arg-Lys-Ile-Leu-Glu-Thr-Tyr...
    asked 22 minutes ago
  • In the figure, a bullet with mass m1 moving directly upward with speed v1i strikes and...
    asked 35 minutes ago
  • Falling light. According to general relativity and the equivalence principle, light is bent by gravity. Consider...
    asked 40 minutes ago
  • Eleana Kim begins her article describing a wedding. She said the wedding was not legitimate but...
    asked 40 minutes ago
  • Fogerty Company makes two products—titanium Hubs and Sprockets. Data regarding the two products follow: Direct Labor-Hours...
    asked 1 hour ago
  • 7. State the angular analogs of Newton’s laws of motion in words and using equations. Rearrange...
    asked 1 hour ago
  • A certain element has an atomic number z = 38. Using the Bohr model estimate the...
    asked 2 hours ago
  • Hydrogen gas can be used in a chemical reaction to produce electricity. This type of electric...
    asked 3 hours ago
  • A possible approach for building a web-based database application is which statements correct? thanks An html...
    asked 3 hours ago
  • The following box model represents the population of those that find their work stressful: [101111101]. Given...
    asked 3 hours ago