/dev/null is to keep grep quiet... otherwise it would output
the line
that
matched. If you want to see it when a match is found, then
you could take that out. The break is there so when it finds
a match it breaks out of the loop, since there's no reason to
keep looping once a match is found.

If you want to pipe the output of scs2ascii through this
script, you would have to do it like so:

#! /bin/bash

file=`cat /dev/stdin`
users="PHILLIP SAM RICHARD"

for user in $users; do
echo "$file" | grep $user >/dev/null && echo "$file" >
/home/misadmin/"$user"_`date
+%Y-%m-%d-%H:%m` && break
done


Thanks again, Toby... I look forward to using this information while
working on my little project over the weekend.

As a side note, O'Reilly Auto Parts came to our town, Monroe, NC., about
a year ago. :-)

Regards,
Mitch


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2021 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.