![]() If some of the programs in the data directory have the same names as system-provided ones and I want my ones to take precedence, then I need to list the data directory first e.g.Įxport PATH=/data/embroil/abc99/my-programs:$PATH Then if the system cannot find a program in any of the standard directories on my path it will check the above data directory. You can add more directories to your PATH, for example if I want the system to know about the programs I have installed in data space on say embroil, in a directory called my-programs, I might add that directory to my PATH, so when I type in the name of the program the system can run it without needing to be told every time where it is.Įxport PATH=$PATH:/data/embroil/abc99/my-programs/ ![]() If your PATH is broken, consider running /alt/bin/shellreset to replace your startup files by the Maths defaults. If not, you may find that you are missing some local commands or running an outdated version of LaTeX. The default PATH is given by this line in our central Bashrc file:Įxport PATH="$/bin:/alt/bin:/usr/local/bin:/bin:/usr/bin."įor your shell to work properly, your PATH must contain the directoriesĪnd /alt/bin must come before the others. PATH is the list of directories in which the shell searches for the commands you type. bashrc calls it, take care not to set the same environment variable differently in both files. Note: Historically DAMTP users have set environment variables in their. The environment variables which you are most likely to need to change are PATH, PRINTER, VISUAL/EDITOR and PS1. If this happens, terminate that session and start a new shell without your changes. Note: modifying environment variables incorrectly can confuse your shell. echo $HOME will tell you where your home directory is. You can see a complete list of them by typing set, or check the value of one variable with the echo command e.g. The bash shell has many environment variables (with names in CAPITALS) which affect its behaviour. Then from any computer you can type the name of the alias - in this case embroil - and you will be put into your data directory there. (replacing user abc99 with your login and embroil with whatever computer you are using for data space). Alternatively consider adding /alt/applic/user-maint/abc99/bin to your PATH - see below.Īn alias to change directory to where your data space is. ![]() If you find it difficult to remember that the unix command cp is used to copy files.Īlias programb=/alt/applic/user-maint/abc99/bin/Īn alias to run a program installed in the shared software area. The alias command is used to rename a command to another or create a short alias for a long command. With the default Maths config files this means adding them after the lines Your changes need to be added after any commands to run global configuration files or they may be overwritten.bashrc to have a lasting effect, not just typed into a terminal window. Remember, all commands mentioned below should be added to your.The reason is that WinSCP runs a non-login shell and gets confused by output from. There is one exception to the above rule: commands producing output should go in. Delete the echo command afterwards - read on to find out why. bashrc and run an ssh session (to ensure you get a login shell). If you want to test whether this happens for you, add an echo command to. Then your shell will behave the same whether it is a login shell or not. bash users can check whether it's a login shell with the command shopt login_shell.When you pop up a terminal window, it should be a login shell but for some old setups it may not be.When you ssh or putty in, it is always a login shell.bashrc, it is because Unix distinguishes between login shells and interactive non-login shells. If you wonder why there are two separate files. This will take a backup of your startup files in case you have any customisations you want to keep. To do this, type /alt/bin/shellreset then log out and back in to get rid of any broken sessions. Should you accidentally muddle these files up or edit them in such a way that some common commands like matlab or pine no longer work for you, you can copy the default ones back into your home directory. Otherwise your changes may be overwritten when the central config files are run. # Add personal customisation commands after this line. Any content you add to these files must be added after the line bash_profile are commands that are executed when you log in. These files are important and should never be deleted no matter how desperate you are for extra disk space (they are short text files so deleting them wouldn't help anyway). To see them use the -a switch with ls i.e. Typing ls fails to see them because they are known as "dot files" or "hidden files". In your home directory you will find files called Customizing the bash shell and its startup files
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |