Create a single command string


Discussion:

Q: Create a single command string that will modify the file called myfile 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 newfile.

Replace the ## in the command string below with the correct characters to make the above described work.
sed 's/!/:/g' myfile | sort -### -t: > ~/newfile

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

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Create a single command string
Reference No:- TGS01932040

Now Priced at $20 (50% Discount)

Recommended (98%)

Rated (4.3/5)