migrating system files (info)

Keith Morse kgmorse
Mon May 17 11:54:17 PDT 2004


Admittedly, this message isn't about self gratification, mental or 
physical. Nor does it deride SCO, Microsoft, or any other targets we like 
to detest.  Hence it may be considered Off Topic.  But what the hell, I'll 
test the waters.


Thiw is somewhat a followup to Michael Hipp's question about password 
issues when migrating to a new server.  To support this effort, I spent 
that last few hours beating my head against the wall trying to figure out 
how to pass command line variables to awk and then use it to pattern 
match.


awk -F: ' ($3 > 99) && ($3 < 65530) { print $1}' /etc/passwd > passwd

for i in `awk -F: ' ($3 > 99) && ($3 < 65530) { print $1}' /etc/passwd`; 
do 
  awk -F:  '$1 == name {print $0 }' name=$i /etc/gshadow
done >> gshadow


for i in `awk -F: ' ($3 > 99) && ($3 < 65530) { print $1}' /etc/passwd`;  
do 
  awk -F:  '$1 == name {print $0 }' name=$i /etc/group
done >> group


for i in `awk -F: ' ($3 > 99) && ($3 < 65530) { print $1}' /etc/passwd`;
do
  awk -F:  '$1 == name {print $0 }' name=$i /etc/shadow
done >> shadow



More information about the Linux-users mailing list