Something like this should work...
users="user1 user2 user3 user4 user5"
file=<name of file>
for user in $users; do
grep $user $file >/dev/null && cat $file > /tmp/"$user"_`date
+%Y-%m-%d-%H:%m` && break
--- - Toby Stanfill
--- - Sr. Programmer/Analyst
--- - O'Reilly Auto Parts
--- - (417)862-2674 ext. 1291
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.