[ale] Read multiple variables

leam hall leamhall at gmail.com
Thu Sep 12 08:44:14 EDT 2013


Ah...

grep person /etc/passwd | awk -F":" '{ print $3, $4, $5 }' |while read U G C
do
 echo U is $U, G is $G, and it's $C"
done


On Thu, Sep 12, 2013 at 8:35 AM, leam hall <leamhall at gmail.com> wrote:

> Well, I used to know how to do this. Trying to get multiple variables set
> in one line:
>
> while read UID GID COMMENT
> do
>  echo UID is $UID, GID is $GID, and it's $COMMENT"
> done < grep person /etc/passwd | awk -F":" '{ print $3, $4, $5 }'
>
> Does not work well at all. Any ideas?
>
> Thanks!
>
> Leam
>
> --
> Mind on a Mission <http://leamhall.blogspot.com/>
>



-- 
Mind on a Mission <http://leamhall.blogspot.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20130912/fead6452/attachment.html>


More information about the Ale mailing list