Hmmm, just loaded the allusers.txt file into pico and did a write out and it now works, must have still been a windows file. Now my modified procedure is below but I only get one entry in the newlist file (either the last one in allusers or the last processed if I interrupt it.
#!/bin/bash while read name; do grep $name smbpasswd > newlist; done < allusers.txt -----Original Message----- From: Simon [mailto:[EMAIL PROTECTED] Sent: Thu, 22. September 2005 3:34 PM To: SLug Users ([email protected]) Subject: Script help Hi all, Can anyone tell me why I get no output from this script? I am not good at writing my own so modify others. I have tested that it is reading the allusers.txt by adding an echo $name #!/bin/bash while read name; do grep $name smbpasswd; done < allusers.txt My basic problem is I have an smbpasswd file where for a couple of years users were not removed properly so that there are about 350 extra users in the smbpasswd file - I want to cut it down to the right size - and be able to reuse the usernames. I have a complete list 'allusers.txt' of all the valid users. Once this worked I was just going to pipe the output to a nwe file. ------------------------------------ OLMC Simon Bryan IT Manager [EMAIL PROTECTED] LMB 14 North Parramatta Direct Number:88381200 SwitchBoard: 96833300 fax: 98901466 mobile: 0414238002 ------------------------------------ -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
