Difference between revisions of "Shells"

From Mu2eWiki
Jump to navigation Jump to search
(Created page with " We use the '''bash''' lunix shell exclusively for the interactive command line and shell scripting. In general, this is the most powerful shell and the professional's choice...")
 
Line 27: Line 27:
 
*[http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html BASH Programming - Introduction HOW-TO], a shorter but less complete introduction.
 
*[http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html BASH Programming - Introduction HOW-TO], a shorter but less complete introduction.
 
*[http://www.tldp.org/LDP/abs/html/index.html Advanced Bash Scripting Guide], starts at the beginning put goes more quickly to advanced ideas.
 
*[http://www.tldp.org/LDP/abs/html/index.html Advanced Bash Scripting Guide], starts at the beginning put goes more quickly to advanced ideas.
 +
 +
[[Category:Computing]]
 +
[[Category:Computing/Infrastructure]]

Revision as of 16:01, 15 February 2017

We use the bash lunix shell exclusively for the interactive command line and shell scripting. In general, this is the most powerful shell and the professional's choice.

Setup scripts

  • .bash_profile is executed once when you login.
    • When you first get a mu2e account, you will be given an example which can be left alone
    • It should source a "products/.../setup.sh" command which defines the PRODUCTS environmental, which allows you to access UPS products.
    • source .bashrc
  • .bashrc
    • When you first get a mu2e account, you will be given an example which would usually be modified
    • set the prompt
    • set any aliases
  • we do not use ".login" or ".profile" which are variants for .bash_profile
  • we do not recommend setting up UPS packages in the bash login scripts since this can get confusing


Standards

  • scripts that intended to be executed by the average user at the command line, should be added to the user's path and can be named with no extension, so it looks built-in.
  • scripts that are used in complex packages, or for special purposes, such as in monitoring, should have extension ".sh"
  • scripts intended to be sourced should have the extension ".sh".

References

The Linux Documentation Project publishes a number of guides that are available online. We suggest: