shell script to print the groups of the users.
xxx
|
Hi,
This looks like homework, which we will not do for you. We are willing to help though. What have you tried and what did or did not work? Hints: Use a loop to read the user names and have a look at the id command. Hope this helps. |
It's your job, intended to train you (not us), so what have you tried so far?
|
nope..it isnt a homework..i was just trying different possible stuff i can do since i just satrted learning bash shell..What i thought of is having a loop..but how to proceed i dont know..
So plz plz give the algorithm for this.. |
Hi,
Have a look at this: Code:
while read NAME; do echo -n "${NAME} : " ; id -nG ${NAME}; done < infile Code:
#!/bin/bash Hope this helps. |
xxx
|
Hi,
If you use a while loop (see post #5) you don't need the export user=`cat groups.sh.....` part. Hope this helps. |
All times are GMT -5. The time now is 05:28 AM. |