Domanda

After executing some util (after pressing Enter) I would like shell to echo 'Oklahoma!' or execute anything else. i.e.:

root@host$ somecommand --version
Some command version 1.00
Oklahoma!
root@host$ ls -la
.
..
dr-xr-xr-x root root 0 Apr 28 2014 file1
dr-xr-xr-x root root 0 Apr 28 2014 file2
Oklahoma!
root@host$ uname -a
Linux hostname 2.6.24-21-generic #1 SMP Mon Aug 25 16:57:51 UTC 2008 x86_64 GNU/Linux
Oklahoma!

Personally I believe that solution is in bashrc, but I don't know how to do this properly. However if you have any other solution, please post it.

È stato utile?

Soluzione

You are probably after the $PROMPT_COMMAND variable.

The man bash says:

If set, the value is executed as a command prior to issuing each primary prompt.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top