• Add a Comment
  • Edit
  • More Actions v
  • Quarantine this Entry

Comments (9)

1 AnthonyEnglish commented Permalink

Good work, Mark. Great to see you have your own blog. <div>&nbsp;</div> We also want set -o vi for shell history, and I like to keep the PWD separate from the shell prompt, which makes it a little easier to cut and paste. <div>&nbsp;</div> Here's what I now have in my .profile <br /> alias aix="export PS1=\"$(hostname) \# \" ioscli oem_setup_env" <br /> export ENV=/home/padmin/.kshrc <div>&nbsp;</div> and here's the .kshrc: <br /> export PS1="$(hostname) $ " <br /> set -o vi <br />

2 MarkChandler commented Permalink

Thanks, Anthony! Baby steps, at this stage. <br /> Thanks also for those extra tips around this subject.

3 AnthonyEnglish commented Permalink

Not sure I've got it right, yet. The aix alias with the export PS1 (instead of PS1) doesn't seem to invoke the oem_setup_env. I'll keep working on it.

4 Tucker commented Permalink

Hello - <br /> I copied and pasted the contents of your .kshrc file onto my vios and got the error shown below: <div>&nbsp;</div> /home/padmin/.kshrc[5]: hostname: not found. <br /> [padmin@vio03]:/home/padmin $ aix <br /> /home/padmin/.kshrc[5]: hostname: not found. <br /> [root@vio03]:/home/padmin # <div>&nbsp;</div> I could not find what was wrong so I resolved it by simply putting the actual hostname instead of the variable. <div>&nbsp;</div> Any thoughts or suggestions? <br />

5 exsnafu commented Permalink

Tucker, are you using VIOS 2.2? i've noticed with my 2.2 servers I also get this, if you put set -x in your .kshrc file though you can see that when you log in, padmin is trying to prepend ioscli to the command which is resulting in error. if you specify the path explicitly though it seems the resolve the issue, here's what i have in my .kshrc: <div>&nbsp;</div> export EXTENDED_HISTORY=ON <br /> export EDITOR=/usr/bin/vi <br /> export NMON=cmOa <br /> export HOST="$(/usr/bin/uname -n)" <div>&nbsp;</div> alias aix="ioscli oem_setup_env" <br /> alias history='fc -t' <div>&nbsp;</div> if [ "$(whoami)" != "root" ]; then <br /> export PS1="$HOST:$PWD $ " <br /> else <br /> export PS1="$HOST:$PWD # " <br /> fi <div>&nbsp;</div> <div>&nbsp;</div>

6 fbux commented Permalink

Hello all, <div>&nbsp;</div> Thanks for this post and comments. <div>&nbsp;</div> @exsnafu using $PWD does not work, even I change directory it is not updating the prompt. Does this config work for you? <div>&nbsp;</div> I'm using SP-03

7 d_aix_doktor commented Permalink

For ioslevel , this gets you past the $PWD issue: <div>&nbsp;</div> Use single quote instead of double and also start the quote after the whoami part, like so: <div>&nbsp;</div> In the /home/padmin/.kshrc file: <br /> export HISTSIZE=2048 <br /> export EXTENDED_HISTORY=ON <br /> alias history='fc -t' <div>&nbsp;</div> if [ "$(whoami)" != "root" ]; then <br /> export PS1=$(whoami)'@$HOST:$PWD:$ ' <br /> else <br /> export PS1=$(whoami)'@$HOST:$PWD:# ' <br /> fi <br /> set -o vi <br />

8 AnkeCen commented Permalink

For ioslevel 2.2 and above, the following works: <div>&nbsp;</div> <div>&nbsp;</div> # cat .kshrc <br /> if [ "$(whoami)" != "root" ]; then <br /> export PS1="$(whoami)@$(/usr/bin/hostname):(\$PWD)$ " <br /> else <br /> export PS1="$(whoami)@$(/usr/bin/hostname):(\$PWD)# " <br /> fi <br /> set -o vi <br /> # <br />

9 Russell Adams commented Permalink

You should consider using 'uname -L' instead of the hostname. This gives you the LPAR ID and LPAR name, which is always present when TCP/IP may not have been configured yet.

Add a Comment Add a Comment