MRG home page · Research · Publications · Projects · Software · People

University of Edinburgh

Command Line Stuff

Your dot files (.brc, .benv)

To set up your bash environment (that's the command line shell where you type things in) to make it work with group stuff, you should have/make a ~/.benv file (even if you didn't have one before).

It should say:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

MRG_DOT_BENV=/group/reason/dream/env/MRG_DOT_BENV

if [ $MRG_DOT_BENV ] && [ -f $MRG_DOT_BENV ];
then
. $MRG_DOT_BENV
fi

# to mimic tcsh

function setenv () {
export $1="$2"
}
# add personal environment settings here

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Similar story for your ~/.brc (you should create one if you don't have one. If you're ex-DAi, you could copy your old ~/.bashrc). The idea is to put environment settings in the .benv, which is only looked at once, and other shell stuff in the .brc .

It should start:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

MRG_DOT_BRC=/group/reason/dream/env/MRG_DOT_BRC

if [ $MRG_DOT_BRC ] && [ -f $MRG_DOT_BRC ];
then
. $MRG_DOT_BRC
fi

# your own bash commands here

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The environment variables $MRGDIR, $MRGLIB, etc point to our shared files. bash completion on "$MRG" will list these for you (type tab twice after $MRG ).

Local Commands

These settings will give you access to a lot of local commands. Highlights include edbib to edit the group bibliography, edblue to edit the Blue Note index, and checkout_lamda_clam, to get a copy of the lambda clam source code from the CVS repository. There's also a nice script called dvi2pdf that makes acrobat readable pdf files. To get documentation on a command called foo, type man foo in your newly configured shell. The list of local (i.e. group specific) commands is here.

Add a tip to this page.

Name: graham
Email: graham.steel@ed.ac.uk

Date: Tuesday, June 8, 2004 at 16:09:53
Tip:

Under the DICE environment students, including postgrads, have usernames which are absolutely no use whatsoever to humans trying to identify them unless you have an excellent memory for 7 digit numbers.

This can cause problems when, for example, someone is running a process on your machine that's slowing it down and you want them to nice it (it's probably me ;-), or someone has a crashed job on the print queue or has accidentally sent 30 copies of a 100 page document etc.

You can find out who it is by using 'finger', but this can be very slow. A faster way to look up the name assosciated with a student ID is to do an LDAP search, e.g.

darnay[s9808756] ldapsearch uid=s9811254 2>&1 | grep cn:
cn: Laura Meikle

That's a lot to type, so you might consider adding something like

function edwho ()
{
command ldapsearch uid=$1 2>&1 | grep cn:
}

to your .brc

then you can:

darnay[s9808756] edwho s9900905
cn: Fiona McNeill

As you might expect, ldapsearch also works for less obfuscated usernames, e.g:

darnay[s9808756] edwho dr
cn: Dave Robertson


Name: Graham
Email: graham.steel@ed.ac.uk

Date: Wednesday, January 29, 2003 at 15:51:51
Tip:

To stop bash from beeping at you, put

set bell-style visible

in your ~/.inputrc file


Name: Graham Steel
Email: graham.steel@ed.ac.uk

Date: Wednesday, January 29, 2003 at 15:36:36
Tip:

Sometimes I like to fill an idle moment by browsing the last 4 or 5 published blue book notes, but usually i can't remember what number we have got to, or who wrote the one i was interested in or whatever. so I have an alias in my .brc which looks like this:

alias last_notes="tail -n 80 /group/reason/dream/lib/notes/blue.txt | grep 'title\|number\|author'"

that way you can type last_notes and get a list which looks like this:

author = {Alan Smaill},
title = {BNF and Normal Forms},
number = 1448}
author = {Predrag Janicic},
title = {Predicting BNFs: Unsolvable in a General Case},
number = 1449}

etc. and then you can do view_note -blue *1449 (or whatever) to have a look...


Name: Ewen Maclean
Email: s9808432@sms.ed.ac.uk

Date: Monday, January 20, 2003 at 15:43:34
Tip:
If you want the bash prompt option "PS1" to work- i.e. what it says at the beginning of every command line, then you will need to put it in your .brc file, not the .benv as is currently the case for the MRG set up. The recommendation is to put the following lines into your .brc file:

# more sensible default prompt

export PS1='\h[${PWD##*/}] '

and remove them from the .benv. This needs to be executed every time a shell runs, so it needs to be in the .brc file. The difference between the relevant dot files for DICE is explained at the DICE FAQ

Name: Ewen Maclean
Email: s9808432@inf.ed.ac.uk

Date: Tuesday, February 4, 2003 at 14:38:37
Tip:

For those people who are interested in detex, as it no longer exists
under the DICE system, you can find a compiled version at:

~s9808432/bin/share/detex



Return to the MRG computing page.