Monday, August 6, 2012

Set the shell prompt with your messages using PROMPT_COMMAND

You can use the PROMPT_COMMAND to make your current shell displaying a message of your own ideas.

Here ''Have a wonderful day" is my message.


[root@tester ~]# PROMPT_COMMAND="echo Have a wonderful day"
Have a wonderful day

[root@tester ~]# date
Mon Aug  6 21:35:43 IST 2012
Have a wonderful day

[root@tester ~]# cat /etc/issue

Red Hat Enterprise Linux Server release 5.1 (Tikanga)
Kernel \r on an \m

Have a wonderful day

[root@tester ~]# unset
Have a wonderful day

[root@tester ~]# date
Mon Aug  6 21:36:35 IST 2012
Have a wonderful day


[root@tester ~]# PROMPT_COMMAND=" "
[root@tester ~]# date
Mon Aug  6 21:37:16 IST 2012

No comments: