A qustion on 'Shell' displaying Group ID, Group Name
First of all, sorry for my typing in English... anyway..
Now I'm working on the assignment manipulating users' and groups' information.
I gotta find a way to display only 'Group ID' and 'Group Name' fields. 've been tried to find a command to do the task, but failed.
Finally I happened to stuck with the file, '/etc/group' and tried to extract the certain feilds like this...
'head -$count /etc/group | tail -1 | sed -e 's/[":x:"[:digit:]:]//g'
Extracting the 'Group ID' field in the way above was quite acceptable, at least I got the correct information, but getting the 'Group Name' fields is such a mess, it came out to be like 'rootroot' instead of just 'root', you know, or 'binroot,bin,daemon' instead of just 'binroot.'
..
This is my first time to work in Shell Scripting and this was the best that I was able to think of...
Guys, please help me out.
cut을 이용하시는게 가장 쉽습니다.[code:1]cut -d
cut을 이용하시는게 가장 쉽습니다.
group 이름과 id만 뽑는다면
식으로 할 수 있습니다. 보다 복잡한 처리를 원한다면 cut 대신에 awk 프로그램을 쓸 수도 있고요.
Thanks!!!! Really appreciate!!!
Thanks!!!! Really appreciate!!!
I'm a novice, guys.
댓글 달기