All entries for Tuesday 13 July 2010

July 13, 2010

Linux tips and tricks

From Dr Nichols on script files:

Make a script file, .sh
  test.sh
must begin "#!/bin/bash"
Give it execute permissions
chmod +x test.sh (Important! If not script will not run!)

and be sure to re-direct all output to a log file

Then when you run the script, put it in the background

  ./test.sh &

Here is my test.sh file

#!/bin/bash

matlab -nojvm -nodisplay < doit.m > test2.log 2>&1

Also, how to start up matlab and add path to matlab every login

Edit ./.bashrc, using say, emacs i.e. at the prompt type "emacs ./.bashrc"

Add the following lines:

module add matlab
export MATLABPATH=$MATLABPATH:$HOME/spm8/

for example, given that I put the spm8 files into /home/spm8/

Useful commands to view log files are cat, tail etc.


July 2010

Mo Tu We Th Fr Sa Su
Jun |  Today  | Aug
         1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Search this blog

Tags

Galleries

Most recent comments

  • Thanks a lot! That does seem to work better! by on this entry
  • You don't need to cat /dev/null into a file to empty it, you can just use > For example: me@mine:/tm… by Mike Willis on this entry

Blog archive

Loading…
Not signed in
Sign in

Powered by BlogBuilder
© MMXXIII