0

I use the following shell script to run a simulation on my cluster.

  #PBS -N 0.05_0.05_m_1_200k
  #PBS -l nodes=1:ppn=1,pmem=1000mb
  #PBS -S /bin/bash
  #$ -m n
  #$ -j oe


  FOLDER= 0.57

  WDIR=/home/vikas/ala_1_free_energy/membrane_200k/restraint_decoupling_pullinit_$FOLDER

  cd /home/vikas/ala_1_free_energy/membrane_200k/restraint_decoupling_pullinit_$FOLDER

  LAMBDA= 0.05

 /home/durba/gmx455/bin/mdrun -np 1 -deffnm md0.05 -v

 ############################

Now my problem is that my script doesn't recognize variable FOLDER and throws an error

     couldn't find md0.05.tpr 

which exist in the folder. If I write 0.57 at the place of $folder,It works fine, which makes me feel that it's not recognizing the variable FOLDER. LAMBDA is recognized perfectly in both of the cases.If somebody can help me here, I will be grateful.

1 Answer 1

2

There should not be a space between the = and the value you wish to assign to the variables:

FOLDER="0.57"

WDIR="/home/vikas/ala_1_free_energy/membrane_200k/restraint_decoupling_pullinit_$FOLDER"

cd "/home/vikas/ala_1_free_energy/membrane_200k/restraint_decoupling_pullinit_$FOLDER"

LAMBDA="0.05"

/home/durba/gmx455/bin/mdrun -np 1 -deffnm md0.05 -v

############################

All of the double quotes "" I added are not strictly necessary for this example, however it is good practice to get into using them.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.