PS1-4

export PS2="continue->"

cat ps4.sh

export PS4='$0.$LINENO+ '

set -x

echo "PS4 demo script"

ls -l /etc/ | wc -l

du -sh ~

ramesh@dev-db ~> ./ps4.sh

../ps4.sh.3+ echo 'PS4 demo script'

PS4 demo script

../ps4.sh.4+ ls -l /etc/



In the PS1 environment variable, you can directly execute any Linux

command, by specifying in the format $(linux_command). In the following

example, the command $(date) is executed to display the current time inside

the prompt.

ramesh@dev-db ~> export PS1="\u@\h [\$(date

+%k:%m:%S)]>

posted on 2014-01-14 15:50  阿加  阅读(150)  评论(0编辑  收藏  举报

导航