script to filter usr and passwd

Thierry ITTY thierry.itty at besancon.org
Wed Aug 3 13:52:24 UTC 2005


>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
>> 
>> A 11:40 03/08/2005 +0400, vous avez écrit :
>> >I want to catch up up all user names and passwords which been created into
>> qmail
>> >I have a file which include the following structure
>> >
>> >name:   peter
>> >passwd: $1$WmPAy$xrW9rd7U3.EGMMKEpe63A0
>> >clear passwd: password
>> >uid:    0
>> >gid:    0
>> >        all services available
>> >dir:       /home/vpopmail/domains/dom/1/peter
>> >quota:     52428800S
>> >usage:     0%
>> >
>> >name:   mark
>> >passwd: $1$WmPAy$xrW9rd7U3.EGMMKEpe63A0
>> >clear passwd: password
>> >uid:    0
>> >gid:    0
>> >        all services available
>> >dir:       /home/vpopmail/domains/dom/1/mark
>> >quota:     52428800S
>> >usage:     0%
>> >
>> >The shell/perl script should catch all user names / clear password and
>> >list like this
>> >username: xxxx   password: yyyy
>> >
>> >Any help?
>> >
>> >--
>> >redhat-list mailing list
>> >unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
>> >https://www.redhat.com/mailman/listinfo/redhat-list
>> >
>> >
>>
>
>-- 
>redhat-list mailing list
>unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
>https://www.redhat.com/mailman/listinfo/redhat-list
>
>
			- * - * - * - * - * - * -
Bien sûr que je suis perfectionniste !
Mais ne pourrais-je pas l'être mieux ?
	Thierry ITTY
eMail : Thierry.Itty at Besancon.org		FRANCE





More information about the redhat-list mailing list