All 1 entries tagged Bash
View all 13 entries tagged Bash on Warwick Blogs | View entries tagged Bash at Technorati | There are no images tagged Bash on this blog
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.