[Email protected] wyb]#CatTest.SH Echo-E"\033[32mhello,this is Wangyuebo ' s shell\033[0m"Echo-E"\033[32m ' Date ' \033[0m"LANG=enEcho-E"\033[32m ' Date ' login at ' hostname ' W ' \033[0m">>/etc/Wangyuebo.log[[email protected] wyb]# when the cue is written in the test.sh script, put the script in the~/.BASHRC file inside can be bash/root/wyb/test.SH[email protected] wyb]#Cat~/. bashrc#. bashrc# User specific aliases and FunctionsaliasRM='rm-i'aliasCP='cp-i'aliasMV='mv-i'# Source Global Definitionsif[-F/ETC/BASHRC]; Then . /etc/BASHRCfiBash/root/wyb/test.SH[[email protected] wyb]# then reopen a shell, you can see the test.sh set in the prompt connecting to192.168.16.110: A... Connection established. To escape to local shell, Press'ctrl+alt+]'. LastLogin: Fri Sep2 xx: -: - .From192.168.16.101Hello,this is Wangyuebo's ShellFri Sep2 xx: +: *Cst .[[Email protected]~]#
Shell script, how to implement every time a new shell is opened to output a prompt?