Logon script


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Logon script
# 1  
Old 12-05-2006
Logon script

Hi:
I am wondering if anyone has a logon script to be put in /etc/profile or environments that will display the logged on username and path?
# 2  
Old 12-05-2006
echo "$USER" # shows username
echo "$(pwd)" # shows current work dir

but I'm not quite sure if thats what you've been looking for.

Darwin
# 3  
Old 12-05-2006
Edit /etc/profile and add the following there

n_name=`whoami`
n_date=`date +%m%d%y`

banner ${n_name} ${n_date}

Why do you need to do this ?
# 4  
Old 12-06-2006
I just wnated to show the user logged in and thier path.

Thanks all.
# 5  
Old 12-06-2006
Be careful with the path (in case it's the $PATH variable you'd like to display). /etc/profile is executed before the personal ~/.profile (where PATH usually is altered to fit the users needs) , so the value you display may not be the one the user actually uses.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find logon user based on executed script proc id

Hi, i have requirement to find logged in user based on process id. i have below scenario. 1. all my users will logon to unix box using ssh from windows system. 2. after successful logon they will sudo to common user. ex. sudo -su edadm lot of users are executing jobs from edadm user and... (2 Replies)
Discussion started by: tmalik79
2 Replies

2. Post Here to Contact Site Administrators and Moderators

Cannot logon using elinks

There are some computers in the firm that have no GUI, so I use elinks (ELinks - Full-Featured Text WWW Browser) to access the internet. However, logging onto the unix.com forums is not possible, because the page hangs at "Thank you for logging onto the forums, " There is also a line "Please click... (6 Replies)
Discussion started by: figaro
6 Replies

3. Shell Programming and Scripting

Logon/Logoff script

I need help for writing a logon/logoff script for recording user's computer usage time. This is for local login only, not for ssh or something like that. When a user logon, there should be a temp file (/home/acct/login_temp) generated including the logname and logon time information in the... (8 Replies)
Discussion started by: jimx
8 Replies

4. AIX

aix logon

how do I create a script to logon to db2inst1 with a password , then issue db2 command :( (5 Replies)
Discussion started by: trekme
5 Replies

5. Shell Programming and Scripting

Logon profile kill script only partially working

I have been having an issue with the new motorola rf scan guns opening up too many sessions at once. It seems they will open a new connection for no reason, leaving the old one in the background and the user has no idea it is happening. To combat this, I have added the following code to the logon... (1 Reply)
Discussion started by: raidzero
1 Replies

6. Shell Programming and Scripting

How to script to logon servers using id and password

Hey.. I am new in scripting.. I know a little bit of scripting.. I am facing some problem.. I need to create a script using which I may log on to a server (e.g. ftp) with ID and password.. thus copy a particular file to a local dir.. the commands required to do that I do know.. I am able to do it... (1 Reply)
Discussion started by: razeeev
1 Replies

7. UNIX for Dummies Questions & Answers

UNIX logon script/batch

Hi everyone, I am a newbies to Unix and hope someone can help me on: 1. Do anyone has batch file example that can be logon to a unix sever through telnet and exec a nohup command without typing in username and passward everytime ? 2. A java script exmaple for doing the same logon so it... (1 Reply)
Discussion started by: oht
1 Replies

8. Shell Programming and Scripting

About Logon

hi how can I know abt the details of current user who are logged on and as well as those users who currently have an account but are not logged on? Thanks (1 Reply)
Discussion started by: nokia1100
1 Replies

9. AIX

umask setting on a logon script

hi, am new to AIX. i have an issue. iam asked to change the umask setting on a logon script on a server to prevent writable files. i logged in as the root user and typed in umask and it displays 022, which i believe is 755 for direc and 644 for files. 1) how to I identify where the logon script... (2 Replies)
Discussion started by: karthikosu
2 Replies

10. UNIX for Dummies Questions & Answers

Can't logon

I stupidly changed the shell of the root user to one that does not exist, and now when I try to lgon it says it cannot find the path to my shell and will not let me proceed any further. Is there any way I can get round this without re-installing the OS? Thanks for any replies. (8 Replies)
Discussion started by: SRP
8 Replies
Login or Register to Ask a Question