Custom AIX Prompt


 
Thread Tools Search this Thread
Operating Systems AIX Custom AIX Prompt
# 1  
Old 07-14-2010
Custom AIX Prompt

In my .profile, my prompt is set like this:

Code:
set -o vi
PS1=`logname`@`hostname -s`:'$PWD>'

Is there a way to show what the history number would be of the command I'm typing in the prompt? For example, I frequently run commands then run 'history' to pull up the history number of a command I want to repeat. Then I do [ESC] -> [history #] -> [g] to get my previous command. If I could show the history numbers in my prompt, this could cut out having to run history over and over again.

Thanks
# 2  
Old 07-15-2010
If you shell has it, it is '!' .

For example.
Code:
PS1='$PWD ! > '

This User Gave Thanks to methyl For This Post:
# 3  
Old 07-15-2010
Thank you!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Kshrc custom prompt will not work

So Yesterday I switched from Solus Linux to Fedora Linux 30, but I forgot to backup some of my dotfiles including kshrc. I am fairly new to Korn shell and do not know it well, but through memory I was able to at least get this. I did use code from several different source to recreate it. The only... (13 Replies)
Discussion started by: zoomer
13 Replies

2. Emergency UNIX and Linux Support

AIX prompt delayed when users increase

I am facing a situation where when there are lesser users, i am able to login to the AIX server. If the number of users increase - the login prompt is getting delayed. Sometimes even timeout occurs. This is after the upgrade to AIX 7.1 TL 4. Can someone suggest a way to overcome this situation? (6 Replies)
Discussion started by: ggayathri
6 Replies

3. Shell Programming and Scripting

Change / Setup bash custom prompt (PS1)

I am trying to create my custom prompt and I have almost succeeded. Right now I have PS1='\n\\$\ ' What I have not figured out is how to make the directories bold when I'm using commands ls or ls -la. Any idea how to do it??? Many thanx. (2 Replies)
Discussion started by: emailkia
2 Replies

4. AIX

how many su - users I ejecute in prompt AIX 5.3

Hi Colleagues, My English is pretty bad, the help I need is this: entered into a machine with OS AIX 5.3 and i execute su - user1 and then i execute su - user2 and then i execute su - user3 and finally its su - user4. there is some command that tells me the its that i have made? Thank you... (2 Replies)
Discussion started by: systemoper
2 Replies

5. AIX

ssh keys - no password prompt from AIX to RPA

hello, i am running an AIX 5.3 machine and i want to connect via ssh to the RPA Management site without prompting for password. i already had a public key of this server as i use the same thing for ssh connection with other AIX machines. i connected to the RPA Management Site and i run the... (9 Replies)
Discussion started by: omonoiatis9
9 Replies

6. UNIX for Dummies Questions & Answers

scp not working because of prompt (AIX, tcsh)

Hello, I have this problem: I have a server to which I ssh, and it has a special prompt request. The prompt is done by a ?prompt command. It is fine with SSH, since the prompt I guess gets some input, but when I use SCP, the copy always fails. So, I was wondering if there is maybe a... (1 Reply)
Discussion started by: lastZenMaster
1 Replies

7. Shell Programming and Scripting

Ksh93 vs. Pdksh88: Custom PS1 prompt not working

Greetings! I have to work with a NFS user id between two hosts: A running Ksh 93 and B running pdksh 88. My problem has to do with the custom prompt I created on A: it works like a charm and display colors: PS1="$'\E But I switch over to B, it all goes to hell (private info... (4 Replies)
Discussion started by: alan
4 Replies

8. AIX

Timestamp in AIX Prompt

I am using ksh under IBM's AIX, version 6.1. I wopuld like to add the current time to my prompt. I understand that I can change the value of $PS1 in my .profile. So far my attempts at setting the time have resulted in setting the time to what it was when the .profile was executed. ( It doesn't... (2 Replies)
Discussion started by: PeterF
2 Replies

9. AIX

Custom libraries possible on AIX 4.2 ?

I had started writting my own custom libraries on an AIX 4.2. Before finishing, I wanted to do a very simple test. So I wrote the followings: test.sh #!/bin/ksh . testlib.sh ZZ=testz "aa" "bb" echo "$ZZ" exit 0 testlib.sh testz () { return "$1$2" } When I ran my test.sh, I got an... (2 Replies)
Discussion started by: Browser_ice
2 Replies

10. AIX

AIX custom package install query

I have created a .bff package for an app to tbe installed on AIX servers across regions. I am pretty new to the AIX mode of packaging using mkinstallp but I have been able to get the same done. I installed the same on the server in which i created the package and the application was deployed... (9 Replies)
Discussion started by: jobbyjoseph
9 Replies
Login or Register to Ask a Question