![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Changing root group to group from other | mjkroner | SUN Solaris | 4 | 03-05-2009 04:25 AM |
| retrieving all group names with a given group number | Andrewkl | UNIX for Advanced & Expert Users | 3 | 10-25-2008 05:07 AM |
| Sort cmd to get GROUP BY? | RacerX | UNIX for Dummies Questions & Answers | 6 | 10-16-2008 08:40 AM |
| Monkcast #12: IBM HW group OEMs Solaris to chagrin of SW group & a ... - ZDNet.com bl | iBot | UNIX and Linux RSS News | 0 | 08-17-2007 05:30 PM |
| entry in /etc/group too long - problem using sudo with %group | poli | SUN Solaris | 4 | 12-21-2004 09:50 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Sort, group rows
I wrote script in bash which generates this report:
User1,admin,rep,User2,shell,path1,x1,r1 User2,admin,rep,User7,shell,path1,x1,r1 User3,admin,rep,User4,shell,path1,x1,r1 User4,admin,rep,User3,shell,path1,x1,r1 User5,admin,rep,User1,shell,path1,x1,r1 User6,admin,rep,User5,shell,path1,x1,r1 User7,admin,rep,User6,shell,path1,x1,r1 ... I would like so that (UserX): User1,admin,rep,User1,shell,path1,x1,r1 User2,admin,rep,User2,shell,path1,x1,r1 User3,admin,rep,User3,shell,path1,x1,r1 User4,admin,rep,User4,shell,path1,x1,r1 User5,admin,rep,User5,shell,path1,x1,r1 User6,admin,rep,User6,shell,path1,x1,r1 User7,admin,rep,User7,shell,path1,x1,r1 ... How to do this ? Thx |
|
||||
|
Hi
Source report: User1,admin,rep,User2,shell,path1,x1,r1 User2,admin,rep,User7,shell,path1,x1,r1 User3,admin,rep,User4,shell,path1,x1,r1 User4,admin,rep,User3,shell,path1,x1,r1 User5,admin,rep,User1,shell,path1,x1,r1 User6,admin,rep,User5,shell,path1,x1,r1 User7,admin,rep,User6,shell,path1,x1,r1 User8,admin,rep,,,path1,x1,r1 User9,admin,rep,,,path1,x1,r1 User10,admin,rep,,,path1,x1,r1 User11,admin,rep,,,path1,x1,r1 ... I'd like to assign user names with numbers User2,User7,User4,User3,User1... from the fourth column to the same users from the first column, so as to obtain the following report: User1,admin,rep,User1,shell,path1,x1,r1 User2,admin,rep,User2,shell,path1,x1,r1 User3,admin,rep,User3,shell,path1,x1,r1 User4,admin,rep,User4,shell,path1,x1,r1 User5,admin,rep,User5,shell,path1,x1,r1 User6,admin,rep,User6,shell,path1,x1,r1 User7,admin,rep,User7,shell,path1,x1,r1 User8,admin,rep,,,path1,x1,r1 User9,admin,rep,,,path1,x1,r1 User10,admin,rep,,,path1,x1,r1 User11,admin,rep,,,path1,x1,r1 ... ps. only users User2,User7,User4,User3,User1... from the fourth column have shell |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|