[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: .htgroup





On Tue, 22 Dec 1998 charles@lunargraphics.net wrote:
> 
> I am currently using .htaccess to secure a directory using basic username
> and password authentication, however, I have multiple username which need
> access to this directory via the web, so I have implemented a .htgroup
> file. The problem that has arisen is that the number of users found in the
> .htgroup file has become so many that editing the file has become quite a
> pain, since in .htgroup, all usernames listed on one contiguous line, and
> my number of users has grown to nearly 300.
> The script I have written (with luci's help), is short, simple and echo's
> a new username to the .htgroup file. Problem is, this echo causes the file
> to wrap for some reason. Is there anyway to prevent this short of opening
> up the file with vi to prevent the word wrap?

As long as the script does something like an "echo -n" (something in perl 
might be easier) that doesn't put a newline character on the line you 
should be alright.  But if you then open the file in say pico, which 
nicely wraps lines it thinks are too long, then you're stuck :).  Just 
don't save it when it asks when you exit.  To then check whether it's 
truely on just one line, do a "head -10 .htgroup | tail -1" (substitute 
10 for whatever line number you want).  The shell may wrap things around 
for you, but it'll still be just the one line.


--
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.