Sponsored Content
Operating Systems AIX How to show hostname infor after login Post 302302927 by linux.cao.ca on Wednesday 1st of April 2009 11:11:47 AM
Old 04-01-2009
for AIX, put the sytax as below into your .profile

# Set prompt to display login@hostname:current directory

PS1='$'LOGIN"@"`uname -n`":"'$'PWD" # "; export PS1


Or for all users, put sytax into /etc/profile as below. It will let all users prompt host name and current directory.

# Set the primary prefix prompt to display machine name and current directory
if [ "`id | grep '^uid=0('`" != "" ]
then
PS1="[`uname -n`:"'$'PWD"] # "; export PS1
else
PS1="[`uname -n`:"'$'PWD"] $ "; export PS1
fi
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Solaris - unknown hostname - how can I change hostname?

Hello, I am new to Solaris. I am using stand alone Solaris 10.0 for test/study purpose and connecting to internet via an ADSL modem which has DHCP server. My Solaris is working on VMWare within winXP. My WinXP and Solaris connects to internet by the same ADSL modem via its DHCP at the same... (1 Reply)
Discussion started by: XNOR
1 Replies

2. AIX

How to disable user login infor?

If user login and don't do anything in 15 mins, the user is kicked off from the server. how to disable it? (5 Replies)
Discussion started by: rainbow_bean
5 Replies

3. Web Development

APACHE: Tie in Web Page login with server login

Hello, I have created a web page on a server using apache and added .htaccess and .htpasswd in the folder for authentification. I was wondering if there was anyway to tie-in the login for this page with the login used to logon to the server. i.e. the same login info. is used for both,... (2 Replies)
Discussion started by: WhotheWhat
2 Replies

4. Cybersecurity

APACHE: Tie in Web Page login with server login

Hello, I have created a web page on a server using apache and added .htaccess and .htpasswd in the folder for authentification. I was wondering if there was anyway to tie-in the login for this page with the login used to logon to the server. i.e. the same login info. is used for both, when... (1 Reply)
Discussion started by: WhotheWhat
1 Replies

5. Solaris

How grep only the capacity infor from df -k using sun solaris

Hello experts, when i get an output for df -k; i get the below output Filesystem kbytes used avail capacity Mounted on /dev/vd/vdisk3 8241689 1973089 6186184 25% / /proc 0 0 0 0% /proc mnttab 0 ... (3 Replies)
Discussion started by: streddy
3 Replies

6. Solaris

error message rmclomv ... SC Login Failure for user Please login:

Hello World ~ HW : SUN Fire V240 OS : Solaris 8 Error message prompts 'rmclomv ... SC login failure ...' on terminal. and Error Message prompts continually 'SC Login Failure for user Please login:' on Single Mode(init S) The System is in normal operation, though In case of rain, Can... (1 Reply)
Discussion started by: lifegeek
1 Replies

7. Shell Programming and Scripting

Show the login of users connected with awk

Hello everyone, I was trying to get the all logins of the users connected with awk, using "w" command, I probe with this: w|awk 'NR>2 {print $1}' But I'm not sure... is it ok? Thank You so much! (2 Replies)
Discussion started by: adiegorpc
2 Replies

8. Emergency UNIX and Linux Support

HP UX - ILO Console hostname different than Machine Hostname...

Hi All, So we added a new HP-UX 11.31 machine. Copied OS via Ignite-UX (DVD)over from this machine called machine_a. It was supposed to be named machine_c. And it is when you log in...however when I'm in the ILO console before logging in, it says: It should say: What gives? And how do... (4 Replies)
Discussion started by: zixzix01
4 Replies

9. UNIX for Advanced & Expert Users

Hostname -f hostname: Unknown host

deleted (0 Replies)
Discussion started by: hce
0 Replies

10. Red Hat

Cannot show graphical login display

Hi all, I'm running Red Hat Enterprise Linux Server 6.3 Santiago. I already installed the X Window package during installation and the graphical login display can be shown normally after installation. Yesterday, I accessed remotely by GUI mode using VNC viewer and somehow it got crashed.... (1 Reply)
Discussion started by: sergionicosta
1 Replies
ENVIRON(7)						 Miscellaneous Information Manual						ENVIRON(7)

NAME
environ - user environment SYNOPSIS
extern char *const *environ; DESCRIPTION
An array of strings called the `environment' is made available by execve(2) when a process begins. By convention these strings have the form `name=value'. The following names are used by various commands: PATH The sequence of directory prefixes that sh, time, nice(1), etc., apply in searching for a file known by an incomplete path name. The prefixes are separated by `:'. Login shells set PATH=:/bin:/usr/bin. Note that the empty space between the `=' and the `:' indicates the current directory. Security aware people move the extra `:' to the end of their path or omit it. HOME A user's login directory, set by login(1) from the password file passwd(5). TERM The kind of terminal for which output is to be prepared. This information is used by programs that wish to exploit special termi- nal capabilities, a screen oriented text editor for instance. The terminal type is set by login(1) from the tty database ttytab(5). SHELL The file name of the users login shell, set by login(1) from the password file passwd(5). TERMCAP The string describing the terminal in TERM, or the name of the termcap file, see termcap(5), termcap(3). EXINIT A startup list of commands read by elvis(1). USER The login name of the user, set by login(1) from the password file passwd(5). LOGNAME Set to the same value as USER. BSD derived systems have USER, System V has LOGNAME, so modern systems have both to avoid problems. Further names may be placed in the environment by the export command and `name=value' arguments in sh(1). Arguments may also be placed in their environment by programs if they use putenv(3). Or in the environment of another program by building a new environment for one of the exec functions that accepts an environment list, like execle(2) or execve(2). It is unwise to conflict with certain sh(1) variables that are frequently set and/or exported by `.profile' files: MAIL, PS1, PS2, IFS. SEE ALSO
elvis(1), login(1), sh(1), execl(2), execve(2), system(3), termcap(3), termcap(5), ttytab(5). 4.2 Berkeley Distribution May 20, 1985 ENVIRON(7)
All times are GMT -4. The time now is 04:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy