Kevin,

On Tuesday 14 November 2006 15:33, Kevin Donnelly wrote:
> I have a list of usernames and passwords in a csv file, and what I'm
> trying to do is loop through each user, run the password through
> htpasswd, and write both to a file for Apache directory restriction.
>
> The usernames and passwords are in fields 9 and 10 of the file
> respectively, and I was trying to do the loop via:
> for user in $(awk 'BEGIN { FS = ";" } ; {print $9}' user_pw.csv)
> do
>       password="awk 'BEGIN { FS = ";" } ; {print $10}' user_pw.csv)

The outer-most (first) double quote on this line is unclosed. BASH 
continues on to the next line looking for its mate. If I put a quote at 
the end of that line, target /etc/passwd, change the FS to ':' and 
change the field numbers to accommodate that file's format, the script 
appears to work.


>       echo "User $user has password $password"
> done


Randall Schulz
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to