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: 3553428 • 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


When you do $cat mygroup you get:


bin!*i386-linux*!1!root,bin,daemon

bin!*m88k*irid4d*!2!root,bin,daemon

bin!*sun3*sun4*!3!

daemon!*i386-linux*!2!root,bin,daemon

dba!*!1000!admin,supp

kmem!*balance*alpha*!3!oneill,mtorpey

kmem!*sun3*sun4*386BSD*!2!root

other!*m88k*!1!operator

root!*balance*m88k*i386-linux*iris4d*!0!root,admin,operator,oneill,bill

rsrv3!*vax*decstation*!31!root

sys!*iris4d*!0!root,bin,sys,adm

sys!*m88k*386BSD*i386-linux*!3!root,bin,sys,adm

system!*vax*decstation*alpha*!0!root,admin,operator,oneill,bill,rboccuzz

Explanation / Answer

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


should be replaced by


   sed 's/!/:/g' mygroup | sort -t: -k 3 -n > ~/newgroup


Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote