script to filter usr and passwd
Mad Unix
madunix at gmail.com
Wed Aug 3 12:25:38 UTC 2005
Many Thanks, it works.
On Wed, 03 Aug 2005 13:52:24, Thierry ITTY <thierry.itty at besancon.org> wrote:
> >where should I place the file name "file"?
>
> hmm, you should "man awk"
>
> thought, assuming the file that contains qmail definitions is named
> "myqmailfile"
> cat myqmailfile | awk '...'
> or
> awk '...' < myqmailfile
>
> will put the result on your display, and
> cat myqmailfile | awk '...' > myuserandpasswordfile
> or
> awk '...' < myqmailfile > myuserandpasswordfile
>
> will put the result in the file named "myuserandpasswordfile"
>
> this is basic unix "plumbery"
>
> hth
>
>
> >
> >> awk '/^name/ {n=$2} /^clear/ {printf "username: " n "\tpassword: " $3
> "\n"}'
> >> should work
> >> needs that all entries are correct (ie no name without password etc)
> >>
> >> hth
More information about the redhat-list
mailing list