Shell script, how to implement every time a new shell is opened to output a prompt?

Source: Internet
Author: User

[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?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.