LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-05-2003, 01:15 PM   #1
igcsteve
LQ Newbie
 
Registered: Jun 2003
Posts: 3

Rep: Reputation: 0
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
 
Old 06-05-2003, 01:34 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 234Reputation: 234Reputation: 234
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.
 
Old 06-05-2003, 01:44 PM   #3
igcsteve
LQ Newbie
 
Registered: Jun 2003
Posts: 3

Original Poster
Rep: Reputation: 0
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.
 
Old 06-05-2003, 01:52 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 234Reputation: 234Reputation: 234
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.
 
Old 06-05-2003, 01:54 PM   #5
igcsteve
LQ Newbie
 
Registered: Jun 2003
Posts: 3

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
htmldoc - a different input from an html file - cubax Linux - General 1 05-16-2005 12:54 AM
PHP: No input file specified pembo13 Linux - General 0 10-03-2004 10:49 PM
Having rm or mv take file input BlueOrb Linux - Newbie 4 06-29-2004 10:42 PM
C++ binary file input CamelofCamelot Programming 1 12-28-2003 07:38 PM
input from a file ?? FredrikN Programming 5 03-30-2002 01:53 AM


All times are GMT -5. The time now is 09:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration