Timestamp in AIX Prompt


 
Thread Tools Search this Thread
Operating Systems AIX Timestamp in AIX Prompt
# 1  
Old 07-28-2010
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 advance as time moves on ). Any ideas ?
# 2  
Old 07-29-2010
Code:
export PS1="[`date +%T`] "

But, I am not sure how to refresh the time.
# 3  
Old 07-29-2010
I don't think this is possible unless you have ksh95.

If you do ...

https://www.unix.com/shell-programmin...rent-time.html
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

AIX : Need to convert UNIX Timestamp to normal timestamp

Hello , I am working on AIX. I have to convert Unix timestamp to normal timestamp. Below is the file. The Unix timestamp will always be preceded by EFFECTIVE_TIME as first field as shown and there could be multiple EFFECTIVE_TIME in the file : 3.txt Contents of... (6 Replies)
Discussion started by: rahul2662
6 Replies

3. Shell Programming and Scripting

To check timestamp in logfile and display lines upto 3 hours before current timestamp

Hi Friends, I have the following logfile. Currently time in india is 07/31/2014 12:33:34 and i have the following content in logfile. I want to display only those entries which contain string 'Exception' within last 3 hours. In this case, it would be the last line only I can get the... (12 Replies)
Discussion started by: srkmish
12 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

How to get a Prompt (PS1) Timestamp under /sbin/sh?

Hi, I'm trying to find out if there is a way to get a timestamp on my Solaris root shell prompt using /sbin/sh? I'm trying to archive something in line with the following: 12:34:26 root@server # 12:34:28 root@server # 12:34:28 root@server # ls ... 12:34:30 root@server # I know there... (1 Reply)
Discussion started by: Solarius
1 Replies

8. AIX

Custom AIX Prompt

In my .profile, my prompt is set like this: 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... (2 Replies)
Discussion started by: ptrotter
2 Replies

9. Shell Programming and Scripting

Command to get File Timestamp including seconds [Aix 5.3]

Is there a command (like ls -l) to get the file time stamp including seconds? The ls -l gives only the HH:MM, No SS I don't have a C compiler to call stat() I don't a command like stat too. Please help. (8 Replies)
Discussion started by: firdousamir
8 Replies

10. UNIX for Advanced & Expert Users

AIX/awk date to unix timestamp

Hello, I am inside a awk script on AIX, I am feeding to awk ls -luNR i need to convert ls -u time format "month day h:m/yr" to Unix epoch time, POSIX time, or aka unix timestamp I do not have strftime funk in my awk, and i have to do this fast meaning that I cannot do a system call in the... (1 Reply)
Discussion started by: nullwhat
1 Replies
Login or Register to Ask a Question