On 6/6/05, Randall R Schulz <rschulz@sonic.net> wrote:
Markus, Andreas,
On Monday 06 June 2005 04:27, Andreas Jaeger wrote:
...
Try: getent passwd uid
Followed by some awk...
Awk??
Put this in a file, make it executable and put the file in a directory in your PATH. Call it "di", perhaps?
-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==- #!/bin/bash --norc
getent passwd uid "$@" |sed -e 's/:.*//'
The down-side is that you get no output and no diagnostic for unknown ID. Fixing that can be an "exercise for the reader."
Andreas
Randall Schulz
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
thanks, something like this should do it then, if the ID is unknown.. -- snip -- #!/bin/bash res=$(getent passwd uid "$@" |sed -e 's/:.*//') if [ "$res" == "" ]; then echo "unknown user id" exit 2 fi -- snap -- markus