Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

cd to the directory called final that is located within my home directory. A cop

ID: 3802624 • Letter: C

Question

cd to the directory called final that is located within my home directory. A copy of the group file called mygroup was created using the ! as the field separator. The fields should be separated using a : not a !. Create a single command string that will modify the file called mygroup and change all occurrences of the ! to a :. The command string must also sort the file numerically on the GID field and then save the output to a file called newgroup. Replace the ## in the command string below with the correct characters to make the above described work. sed 's/!/:/g' mygroup | sort -t: -k## > ~/newgroup

Explanation / Answer

sed 's/!/:/g' mygroup | sort -t: -k3 > ~/newgroup

GID is present at 3rd field in the output. -k option in sort will sort on column specified after k

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote