Can anyone please assist me with this
by elooo from LinuxQuestions.org on (#5SG5M)
1. Create a file named diff.txt inside your ~/workspace/project-log/ directory with the following format:
Version: 2.0
username: current_user
< ~/workspace directory visible content list >
2. Grep the differences between the~/workspace/project-log/changelog.txt file content against the ~/workspace/project-log/diff.txt file content and append the results to the ~/workspace/project-log/changelog.txt file
TIP: Try using autocompletion shortcuts, relative paths and string interpolation
I HAVE TRIED THIS 3 METHODS BUT STILL GETS ERRORS
METHOD 1
$ touch ~/workspace/project-log/diff.txt
$ echo "Version: 2.0" > ~/workspace/project-log/diff.txt
$ echo "username: current_user" >> ~/workspace/project-log/diff.txt
$ ls ~/workspace >> ~/workspace/project-log/diff.txt
METHOD 2
$ echo "Version: 2.0" > ~/workspace/project-log/diff.txt
$ echo "username: current_user" >> ~/workspace/project-log/diff.txt
$ ls ~/workspace >> ~/workspace/project-log/diff.txt
METHOD 3
$ echo -e "Version: 2.0" >> diff.txt echo -e "username: $(whoami)">>diff.txt ls >>~/workspace/project-log/diff.txt
$grep -v -F -x -f changelog.txt diff.txt >> changelog.txt
Version: 2.0
username: current_user
< ~/workspace directory visible content list >
2. Grep the differences between the~/workspace/project-log/changelog.txt file content against the ~/workspace/project-log/diff.txt file content and append the results to the ~/workspace/project-log/changelog.txt file
TIP: Try using autocompletion shortcuts, relative paths and string interpolation
I HAVE TRIED THIS 3 METHODS BUT STILL GETS ERRORS
METHOD 1
$ touch ~/workspace/project-log/diff.txt
$ echo "Version: 2.0" > ~/workspace/project-log/diff.txt
$ echo "username: current_user" >> ~/workspace/project-log/diff.txt
$ ls ~/workspace >> ~/workspace/project-log/diff.txt
METHOD 2
$ echo "Version: 2.0" > ~/workspace/project-log/diff.txt
$ echo "username: current_user" >> ~/workspace/project-log/diff.txt
$ ls ~/workspace >> ~/workspace/project-log/diff.txt
METHOD 3
$ echo -e "Version: 2.0" >> diff.txt echo -e "username: $(whoami)">>diff.txt ls >>~/workspace/project-log/diff.txt
$grep -v -F -x -f changelog.txt diff.txt >> changelog.txt