11-10-2001
How to store username
I would like to write files to a directory (not under the user's home) which includes the userid.
Example:
userid = john
John's home dir is /home/john
I want to create a directory /var/prog/john
MSG_HOME=/var/prog; export MSG_HOME;
USR_NAME=@@@@; export USER_NAME;
if [ ! -d "$MSG_HOME/$USR_NAME" ];
then
mkdir $MSG_HOME/$USR_NAME || USAGE_EXIT "Unable to create " "$MSG_HOME/$USR_NAME "
fi
How do i define @@@@ ?
id -u -n will return john
but how do I get is assigned to USR_NAME?
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Is there a way to grab the username who is running the shell script. I am trying to do is:
$ who am i
Peterd123 pts/5 Mar 20 09:30 (H0021563.xyz.com)
Is there a way to display only the user name above, which is"Peterd123".
Thanks
Raj (3 Replies)
Discussion started by: rkumar28
3 Replies
2. Post Here to Contact Site Administrators and Moderators
I want to change my username how can I (1 Reply)
Discussion started by: alnita
1 Replies
3. Post Here to Contact Site Administrators and Moderators
Is it possible to change my username in this site or is thre a way to delete my account and then create a new one with a diffrent user name (2 Replies)
Discussion started by: floresr
2 Replies
4. Shell Programming and Scripting
Hi All,
Good morning !!
I have to connect to a sftp server using following details,
1) username contains "@" as part of it. eg: xyz@abc@servername
2) We have to use password to connect to the server.
Could you please advise the solution for this?
Thanks in advance
Regards,
Mohan (1 Reply)
Discussion started by: mohanpadamata
1 Replies
5. Shell Programming and Scripting
Hi
I am new to using unix and am struggling with a script i am writing. What i am trying to do is get a user to enter a username, check the original file i created with username and pin to see if their is a corresponding entry. Next ask the user to enter the pin and see if this matches... (5 Replies)
Discussion started by: somersetdan
5 Replies
6. Post Here to Contact Site Administrators and Moderators
I know username is the unique id for my unix_dot_com account, but is it possible change it ? should i raise any special request to moderators ? (2 Replies)
Discussion started by: Arun_Linux
2 Replies
7. Post Here to Contact Site Administrators and Moderators
Hi,
I'd like to change my username.....
is there a mechanism to do this or can you do it? (1 Reply)
Discussion started by: Martincorneuk
1 Replies
8. Post Here to Contact Site Administrators and Moderators
After mis-typing my password once, I logged in. And after the "welcome Clovis_Sangrail" message displayed for a little less than a second, the display changed to a screen to recover my username and/or my password (it prompted for an email address).
Clearly, I don't need to do that. Maybe... (1 Reply)
Discussion started by: Clovis_Sangrail
1 Replies
9. UNIX for Beginners Questions & Answers
Greetings,
The title pretty much says it all. I've snooped everywhere and can't find anything on this. Since our organization went to numeric usernames, using the u|U option for ps returns no processes. Example passwd entry:
320074:DjZAJKXun8HBs:10129:6006:Joe Y:/cadhome/analysis/jy:/bin/bash... (4 Replies)
Discussion started by: crimso
4 Replies
LEARN ABOUT DEBIAN
xpausers
xpausers(7) SAORD Documentation xpausers(7)
NAME
XPAUsers - Distinguishing Users
SYNOPSIS
XPA normally distinguishes between users on a given host, but it is possible to send data to access points belonging to other users.
DESCRIPTION
A single XPA name service typically serves all users on a given machine. Two users can register the same XPA access points on the same
machine without conflict, because the user's username is registered with each access point and, by default, programs such as xpaget and
xpaset only process access points of the appropriate user. For example:
XPA xpa1 gs 838e2f67:1262 eric
XPA xpa2 gs 838e2f67:1266 eric
XPA xpa1 gs 838e2f67:2523 john
XPA xpa2 gs 838e2f67:2527 john
Here the users "eric" and "john" both have registered the access points xpa1 and xpa2. When either "john" or "eric" retrieves information
from xpa1, they will process only the access point registered in their user name.
If you want to access another user's XPA access points on a single machine, use the -u [user] option on xpaset, xpaget, etc. For example,
if eric executes:
xpaget -u john xpa1
he will access John's xpa1 access point.Use "*" to access all users on a given machine:
xpaget -u "*" xpa1
Note that the XPA Environment Variable XPA_NSUSERS can be used to specify the default list of users to process:
setenv XPA_NSUSERS "eric,john"
will cause access points from both "eric" and "john" to be processed by default.
SEE ALSO
See xpa(7) for a list of XPA help pages
version 2.1.14 June 7, 2012 xpausers(7)