Shell script
brad
brad at bradandkim.net
Wed Nov 12 16:59:24 CST 2003
Hmmm....same thing. I was trying to send useradd the flags -g, -d, and
-s, so I trimmed it down to just plain old /usr/sbin/useradd $1 and I
get the same thing. Since I can run my whole useradd line manually (of
course replacing the variable with a real username) and it runs fine, I
don't think my usage is off. I still think it is having trouble picking
up the variable. Again, just echoing $1 provides nothing. I will keep
digging.
Thanks,
Brad
Scott wrote:
> Let me give the script to you again.... I think it's just a typo...
>
> #!/bin/sh
> while read ALINE
> do
> IFS=|
> set ALINE
> /usr/sbin/useradd -c "$1 Account Whatever Comment Here" $1
> echo $2 | /usr/bin/passwd --stdin $1
> done
>
>
> That aught to get it for you....
>
> scottm
More information about the Kclug
mailing list