You are not logged in.

#1 2007-05-17 20:26:45

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

what a shell is executing...

PS1 environment variable at the moment is:
'\[\e]2;\u ${PWD}\a\]\u@\h \W '
I'll tell the meaning for not xterm native speakers,
\[ avoids that bash counts the characters as printable ones,
\e]2; the escape sequence that sets the xterm title
\u username
${PWD} the current folder
\a end of the title
\u username
@ symbol
\h hostname
\W working directory.

Since I have often many open terminals, I make confusion about who makes what. Is there a way to outputs the last executed command, so I can add it to the xterm title?

Offline

#2 2007-05-18 06:45:22

luca
Member
From: Rome
Registered: 2005-10-30
Posts: 280

Re: what a shell is executing...

Hi ezzetabi,
try with this command:

fc -ln|tail -1

Offline

#3 2007-05-18 08:18:40

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Re: what a shell is executing...

Cool, thanks for the idea. You can even save a process with:
fc -ln -1

Offline

#4 2007-05-18 10:20:55

paem
Member
Registered: 2006-10-09
Posts: 14

Re: what a shell is executing...

Offline

Board footer

Powered by FluxBB