hi gurus,
I can get the user id of a file / directory in perl using the below snippet.
$uid = (stat("$pgm_name"))[4];
chomp($userid = qx!cat /etc/passwd | cut -f 1-4 -d ":" | grep -i ":$uid:" | cut -f 1 -d ":"!);
printf "%s\n", $userid;
I need to get the user id in a kshell script. Something like the below
USERID=`perl -e "XXXXXX"`
Any suggestions / alternatives ?
Thanks
philipose
I can get the user id of a file / directory in perl using the below snippet.
$uid = (stat("$pgm_name"))[4];
chomp($userid = qx!cat /etc/passwd | cut -f 1-4 -d ":" | grep -i ":$uid:" | cut -f 1 -d ":"!);
printf "%s\n", $userid;
I need to get the user id in a kshell script. Something like the below
USERID=`perl -e "XXXXXX"`
Any suggestions / alternatives ?
Thanks
philipose