>
>?????????? ??? ???????? ?????? ?? bash.
>???? ???? /etc/passwd ? ???????:
>
>xfs:x:43:43:X Font Server:/etc/X11/fs:/bin/false
>ihor:x:42:42::/dev/null:/sbin/nologin
>rpcuser:x:30:30:RPC Service User:
>...
>
>????? ?? ??????? ??????? ???????? stdout ????:
>xfs
>ihor
>rpcuser
>...
>(?????? ?? ??????? ?????? ???? - ?????????? ":x")
>
>??? ? bash ??????? ????? ?????????? ?
>????????? ?? ??????.
"?????" ????????? ???????:
VVV="111:222:333:444:555:666"
pattern=':*'
echo ${VVV%%${pattern}}
??? ??? ?????:
pattern=':*'
IFS=$'\n'
for l in `cat /etc/passwd`; do echo "${l%%$pattern}"; done
????? ???? ??? ????????????? ?????? cat ? ?????? ?????????? awk
awk -F: '{ print $1 }' /etc/passwd
??????? awk ??????? ????? ?????? ? ?????? ? ?????? ??????? ??????????? ?????????? ???? ???????? ? ????????? ??????? ???????
:))
???????
--- sas