Results 1 to 3 of 3
Is there a code you can put that automatically inputs the username of the current user? for example something like $user would automatically indicate "administrator" if that was the name ...
- 08-03-2008 #1Just Joined!
- Join Date
- Jul 2008
- Posts
- 17
Is there a way to specify the current username in a script?
Is there a code you can put that automatically inputs the username of the current user? for example something like $user would automatically indicate "administrator" if that was the name of the currently logged in user?
- 08-03-2008 #2Linux User
- Join Date
- Jun 2007
- Posts
- 318
There are a couple of ways.
orCode:usr="$USER"
Code:usr="`whoami`"
- 08-07-2008 #3Just Joined!
- Join Date
- Dec 2007
- Location
- bangalore
- Posts
- 38
can also use echo $LOGNAME


Reply With Quote