|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | 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. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Get username in script
how would i go about getting the username of the person currently logged in, and then using the username in a shell script? i've tried variations of
user=whoami , 'whoami' , $whoami , and none of the above work lolI'd like to get the username to then mount a network share such that the command would be, mount_afp afp://username@dc.fqdns.edu/username /Users/username/Desktop/Home any help on how to accomplish this would be IMMENSELY appreciated :] thanks |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Quote:
mount_afp afp://$user@dc.fqdns.edu/$user /Users/$user/Desktop/Home ? thanks :] /* edit */ the second method worked, export user=$(whoami) when i try: mount_afp afp://$user@dc.fqdns.edu/$user /Users/$user/Desktop/Home i get this error: Quote:
Last edited by willc0de4food; 02-12-2007 at 03:40 PM.. |
|
#4
|
|||
|
|||
|
I am not sure of mounting devices, but following the unix syntax you could try
mount_afp afp://${user}@dc.fqdns.edu/${user} /Users/${user}/Desktop/Home do let me know if it works? |
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
mm..i believe the problem is it wants the password? the command is supposed to be setup as afp://username:password@dc.fqdn.edu/.... but if the computers already logged in to active directory, itd be nice if the password wasn't required. otherwise there would have to be some form of input (i'm guessing) to get the password?
=\ Last edited by reborg; 02-12-2007 at 06:19 PM.. |
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
If you are talking about retreiving the passwords from unix box then forget it because in unix the passwords are stored in the encrypted format which even the administrators cant retreived.
for further reference you could try this link. http://www.hmug.org/man/8/mount_afp.php |
| Sponsored Links | |
|
|
#7
|
|||
|
|||
|
no, i dont mean retrieving passwords.. i mean prompting the user to enter their password and using that in the shell script. except i'm unsure how i'd like to go about this or if i should just try some crazy concotion of applescript/shell script..maybe use a shell script to execute an applescript. lol thanks for your help though :]
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script to see if a username is valid. | TheRealNapsta | UNIX for Dummies Questions & Answers | 1 | 11-08-2011 10:28 AM |
| Using a script to check the login and username (html) | hakermania | Programming | 4 | 03-21-2010 04:08 PM |
| Need to modify a file of different username through script. | dashok.83 | Shell Programming and Scripting | 2 | 11-26-2008 11:17 PM |
| Find username of user running the script | garric | Shell Programming and Scripting | 1 | 06-10-2008 03:44 AM |
| username password in script | roshanjain2 | Shell Programming and Scripting | 5 | 02-13-2007 04:47 AM |
|
|