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)
echo "User $user has password $password"
done
But that gives an error:
bash: syntax error near unexpected token `" } ; {print $10}' user_pw.csv"'
I've tried escaping the ";" in different ways, but none of them seem to work.
Can anyone suggest a way to get bash to do what I want?
--
Pob hwyl / Best wishes
Kevin Donnelly
www.kyfieithu.co.uk - KDE yn Gymraeg
www.eurfa.org.uk - Geiriadur rhydd i'r Gymraeg
www.rhedadur.org.uk - Rhedeg berfau Cymraeg
www.cymrux.org.uk - Linux Cymraeg ar un CD
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]