#! /bin/bash # This script usez the data in users.dat and randompass.dat to merge an user from users.dat to a corresponding passwd from randompass.dat. The resultant file is userpass.dat paste users.dat randompass.dat | awk '{print $1, $2, $3 $4}' > userpass.dat cat userpass.dat| awk '$2 !~/^[0-9]/{print }' > temp.dat length=$(cat temp.dat | awk 'END{print NR}') mv temp.dat userpass.$length.dat