Hello,
So i have this file called /apps/turnout which looks like that of the contents of the /etc/shadow (but not exactly)
the file has a long list in it. basically, the contents of this file looks something similar to the following:
jajajajalala:D#$#AFVAdfda
lalabavisof:#%R@fafla#$
anthovolad:#%)@#Fafdf834
The first field is the username, the second field is something else.
now, how can i insert a new username into the this file in a alphabetical order without actually going into the file. i hate having to vi/emacs/ed or whatever when i dont have to.
so, in otherwords, say i have a name like:
mjackson:#$#$#$%adf#$#
and i want to insert it into the file /apps/turnout so it is placed inside the file in its alphabetical place, how do i accomplish that from the command line.
(i dont want to do the other technique of copying the original file, editing the copy and then rewriting the original.)