Thanks to everyone who helped me out with my previous problem regarding
making links using sed. It worked!
I hope I am not too repetitive if I ask another question regarding the
use of sed and awk. Please ignore the problem outlined below if you find
it annoying.
The second question I have is regarding insertion of a name in the fifth
field of a password file.
The password file has username, UID, GID already but is missing the full
name in the fifth field, eg
I have a password file with several entries:
jones::5001:5000::/home/bilby/forensic/jones:/bin/zsh
smith::5002:5000::/home/bilby/forensic/smith:/bin/zsh
In the fifth field I would like to insert names. They are sorted in a
file and match the lines in the password file so that from a file which
contains:
Michael Jones
Paul Smith
etc
I would like to end up with:
jones::5001:5000:Michael Jones:/home/bilby/forensic/jones:/bin/zsh
smith::5002:5000:Paul Smith:/home/bilby/forensic/smith:/bin/zsh
The problems is that this process requires two input files ie the file
containing the names and the password file. Therefore a loop using
for i in `cat $1`
cannot be used as $1 either refers to the file with names or the
password file and not to both.
Is there any way of doing this, maybe a combination of sed and awk?
I hope I am not exhausting people's patience with these questions.
Thanks in advance
Hugo
--
Dr Hugo Bouckaert - Systems Administrator, Computer Science UWA
Tel: +(61 8) 9380 2878 / Fax: +(61 8) 9380 1089
Email: [EMAIL PROTECTED] / Web: http://www.cs.uwa.edu.au/~hugo