Shells: Difference between revisions

From Mu2eWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:


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.
We use the '''bash''' linux 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==
==Setup scripts==

Revision as of 22:25, 21 September 2017

We use the bash linux 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: