How can I get only the number of the UID from id command?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How can I get only the number of the UID from id command?
# 1  
Old 05-09-2006
How can I get only the number of the UID from id command?

Hello
im using sun Solaris, I need to get the user id number (generating unique id's)
but I fail to find switch to get only the number of the id

thanks for the help
# 2  
Old 05-09-2006
id

id -u --> does it work?
# 3  
Old 05-09-2006
no it gives me

id: illegal option -- u
Usage: id [-ap] [user]
# 4  
Old 05-09-2006
try getuid

I am not sure what is the command in Sun Solaris. I work in HP-UX. Why not write a wrapper c code to return uid using getuid() function.
# 5  
Old 05-09-2006
I have some restrictions can't use external wrappers
Only build in commands
any way maybe I will ask in sun Solaris forum , tnx
# 6  
Old 05-09-2006
Error

i've answered on the solaris section

""i've closed this thread -> cross posting""

regards PRESSY
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Using the "find" command to look for multiple UID's

I have a security audit requirement to produce a list of files that a specific list users have access to. In other words, I'm trying to use find to search files which user1 owns OR user2 owns OR user3 owns, and so on. Can this be done on one command line or do I need to use a for loop and just loop... (15 Replies)
Discussion started by: westmoreland
15 Replies

2. Solaris

New root account with Different UID number

Hi Unix Gurus . I have requirement where in which - I would like create duplicate root equivalent account with all the privileges equal to root. Is it possible to create this duplicate account with different UID. ? this id i would like give it to my teams - who does multiple activities using... (2 Replies)
Discussion started by: johnavery50
2 Replies

3. Solaris

Changing uid value

Hi, I want to change user id gefadm ,uid=0(root) gid=0(root) to uid=16649(isaadmin) gid=16284(dstage), how can i change this uid ,gid one value to another value. Please provide the steps how can i change , uid=0(root) gid=0(root) to uid=16649(isaadmin) gid=16284(dstage). Thanks in advance for... (2 Replies)
Discussion started by: sridhardwh
2 Replies

4. AIX

More than 1 UID 0

Hi, Can any one please tell what are the risks of having more than one users having UID 0 (root)? Thanks Naveed (9 Replies)
Discussion started by: naveedaix
9 Replies

5. Shell Programming and Scripting

UId

is tty command opens a process in the system if yes then why process got the userid????? (5 Replies)
Discussion started by: Mac91
5 Replies

6. UNIX for Advanced & Expert Users

Numeric uid and gid in ls -l command

I´m listing the contents of a directory using the command ls -lI get numeric uid and gid for some lines. example: drwxr-xr-x root root 1970-01-01 01:00 sys -rw-r--r-- 501 20 0 2010-08-04 14:54 shutdown.bravo.rc drwxr-x--- 501 20 ... (5 Replies)
Discussion started by: flocki
5 Replies

7. Shell Programming and Scripting

Shall I go for uid or ppid?

Hi Guys, I'd like to ask your advice on the following, I've written this script to terminate a given process by name: #!/bin/bash echo 'Please enter the process you wish to terminate' read process pid=$(pidof $process) kill -9 $pid echo $2 to make it safer I want it to reject the... (4 Replies)
Discussion started by: Lora Graham
4 Replies

8. Solaris

How can I get only the number of the UID from id command?

Hello (sorry for the cross posting ) im using sun Solaris, I need to get the user id number (generating unique id's) but I fail to find switch to get only the number of the id when i try to do id -u , i got: id: illegal option -- u Usage: id thanks for the help (2 Replies)
Discussion started by: umen
2 Replies

9. UNIX for Dummies Questions & Answers

Reversing UID's

Is it possible given a uid to determine information about the person with the uid? An example would be simple information regarding what group and the name of the person associated with that uid. It seems there is probably an easy staring me in the face but i cant seem to find it... (3 Replies)
Discussion started by: dreaming1
3 Replies

10. UNIX for Dummies Questions & Answers

UID problem

I'm teaching myself UNIX, so bear with me! :) I created two user accounts on my box. One day I shut down the system using "shutdown -h 1". The system shut down cleanly. A few days I rebooted the box, no problem. But root is the only account that can log in. The other 2 user accounts... (10 Replies)
Discussion started by: ChrisFoxx
10 Replies
Login or Register to Ask a Question