문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top