Question

Reading file content in the CLI Collapse 3. 2. Challenge Content concatenation Evaluate your content concatenation skills by

Any help would be appreciated.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

List Of Commands

1. cat - command in unix shows you the content in the file.

2. >> - Using two right facing angular brackets in command you can output the content of command on the left( left to brackets) to right(of brackets).

3. echo - command writes the evaluation of the right part(right of echo) to console.

4. whoami - command shows you the current user on linux/unix cli.

5. $(any) - Dollar and brackets covering any command, will evaluate the command and assign or print to console/variable as necessary.

Answers:

1. echo "username: "$(whoami) >> ~/workspace/project-log/changelog.txt

Above command will append the content of echo "username: "$(whoami) to File ~/workspace/project-log/changelog.txt

echo "username: "$(whoami) - concatenates username: and output of whoami command and prints onto std output.

>> ~/workspace/project-log/changelog.txt - copies the echo content from above to end of file changelog.txt

2. cat ~/workspace/project-log/file-list.txt >> ~/workspace/project-log/changelog.txt

Above command reads(using cat) the content of file file-list.txt and appends it to ~/workspace/project-log/changelog.txt using >>.

Changelog Version: 1.0 changelog.txt (END)Changelog: Version: 1.0 usernane asheeshbisht changelog.txt (END)[asheeshbishtasheeshbishts less changelog.txt [asheeshbisht: asheeshbisht $ less changelog.txt [asheeshbisht: asheeshbisht$ l(asheeshbishtasheeshbishts less changelog.txt [asheeshbisht: asheeshbisht$ less changelog.txt [asheeshbisht: asheeshbisht$ leChangelog: Version: 1.0 username:asheeshbisht Changelog.txt (END)​​​​​​​

Add a comment
Know the answer?
Add Answer to:
Any help would be appreciated. Reading file content in the CLI Collapse 3. 2. Challenge Content...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • file content in the CLI Challenge Content concatenation Evaluate your content concatenation skills by completing the...

    file content in the CLI Challenge Content concatenation Evaluate your content concatenation skills by completing the following tasks: workspace/project- 1. Append the current user to the log/changelog.txt file: Changelog: Version: 1.0 username: current_user 2. Append the workspace/project-log/file-list.txt file content to the --/Workspace/project-log/changelog.txt file: Changelog Version: 1.0 username: current_user hello.txt hi.txt project-log TIP: Use the tab autocompletion shartout

  • 3. 2. Challenge Content concatenation Evaluate your content concatenation skills by completing the following tasks: Append...

    3. 2. Challenge Content concatenation Evaluate your content concatenation skills by completing the following tasks: Append the current user to the ~/workspace/project-log/changelog.txt file: Changelog: Version: 1.0 username: current_user Append the ~/workspace/project-log/file-list.txt file content to the ~/workspace/project-log/changelog.txt file: Changelog Version: 1.0 username: current_user hello.txt hi.txt project-log TIP: Use the tab autocompletion shortcut Once you have completed these tasks press the Check It button to have your solution assessed. Check It!

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT