|
|
#1 |
|
Need help with a shell script
I'm trying to write a shell script that creates a run script for running an executable. The issue is i'm using variables to assign the job name and number of processors etc contained in the run script, but then within the run script itself it has path name variables which when i run the script get removed since they're not defined higher up.
Code:
########### #!/bin/bash read -p "How many processors? : " PROCNUM echo "" read -p "What's the jobname? : " NAME echo "" read -p "What's the walltime? : " WALLTIME echo "" cat <<EOF >run.computer #!/bin/bash --login #BSUB -n $PROCNUM #BSUB -J $NAME #BSUB -W $WALLTIME MYPATH=/home/work/$LSB_JOBNAME executable=$MYPATH/executable WDPATH=/server/$USER/$LSB_JOBNAME mkdir -p $WDPATH cp $MYPATH/data $WDPATH/ cd $WDPATH # $LSB_DJOB_NUMPROC is supplied by LSF and is number of processes mpirun -np $LSB_DJOB_NUMPROC $executable EOF ########## Last edited by OllyW; Nov 30, 2012 at 10:22 AM. Reason: Please use code tags |
|
|
|
0
|
|
|
#2 |
|
Sorted it needed to put a backslash before the necessary dollars
|
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 05:55 AM.






Linear Mode
