[K12OSN] More scripting help...

Petre Scheie petre at maltzen.net
Thu Sep 8 14:03:58 UTC 2005


You already solved your problem, but for the record (and anyone searching the archives 
in the future), would something like this work without requiring you to change the 
spaces to underscors and back:

cat $1 |while read LINE
do
   username=`echo $LINE | cut -f1 -d:`
   password=`echo $LINE | cut -f2 -d:`
   name=`echo $LINE | cut -f3 -d:`
   mypasswd $username $password "$name"
done

Petre

Shawn Powers wrote:
> 
> On Sep 8, 2005, at 9:07 AM, Shawn Powers wrote:
> 
>> for lines in `cat $1`
> 
> 
> Ok, here's my problem, but I don't know how to get it right.  If I do  
> the above, the space in the Name field gets split into 2 lines, so  
> apparently a "for" loop doesn't consider it a whole line using it  this 
> way.  Grrr....
> 
> I could awk/sed the spaces into underscores, and then do the opposite  
> to get the spaces back -- but there MUST be an easier way.
> 
> This might be fun if I wasn't so under the gun...
> 
> _______________________________________________
> K12OSN mailing list
> K12OSN at redhat.com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>
> 




More information about the K12OSN mailing list