LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   input file to htpasswd (https://www.linuxquestions.org/questions/linux-newbie-8/input-file-to-htpasswd-63844/)

igcsteve 06-05-2003 12:15 PM

input file to htpasswd
 
I have a list of users and passwords that I would like to input to htpasswd but keep getting errors. I have tried a couple of different scripts and get the following;
: bad interpreter: No such file or directory

this is the current script;

#!/bin/bash

for line in `cat users.asc`
do
name=`echo $line | cut -f 1 -d ';'`
password=`echo $line | cut -f 2 -d ';'`

htpasswd -b .htpasswd $name $password
done

Any suggestions of what I am doing wrong?
Thanks

trickykid 06-05-2003 12:34 PM

Did you make the script executable?

chmod +x <filename>

Also might want to place the full path to the file users.asc in your script just in case the script isn't in the same directory as the file itself.. etc.

igcsteve 06-05-2003 12:44 PM

Thanks for the suggestion but yes, it is executable and I added the full path name of both files but still get the same error.

trickykid 06-05-2003 12:52 PM

Where are you placing this script at? Is it in your current path? Or have you tried typing it like ./<scriptname>

Cause the error your recieving clearly states its not running the script as it states, no such file or directory.

igcsteve 06-05-2003 12:54 PM

It's in the same directory as the 2 files - /home. I am trying to execute it from that directory using ./script


All times are GMT -5. The time now is 07:57 PM.