[gmx-users] ERROR IN BASH SCRIPTING

Mark Abraham mark.j.abraham at gmail.com
Tue Feb 28 16:48:23 CET 2017


Hi,

This is not about the logical windows in your system. I'm talking about
your operating system Microsoft Windows. Using cygwin means you have to
handle the intricacies of having two different kinds of operating system
running...

If you used e.g. notepad from Windows to edit the bash file, then the bash
from cygwin won't understand it. The errors look consistent with that. You
can fix that by running the script through dos2unix. Next time, do that, or
use an editor that comes from cygwin.

Be sure you read things like
https://cygwin.com/cygwin-ug-net/using-effectively.html so you understand
your own tools.

Mark

On Tue, Feb 28, 2017 at 11:54 AM Subashini .K <subashinik at hotmail.com>
wrote:

> Hi,
>
>
> Thank you for the reply.
>
>
> WINDOW represents the distance between two identical molecules in
> umbrella sampling method.
>
>
> In order to avoid having 26 different mdp files, we use the bash script
> use  to loop through and run each state .
>
>
> This was developed by WESBARNETT (displayed in the tutorial link)
>
>
> But, I am unable to run the bash script.
>
>
> My question is in which folder the bash script must be placed?
>
>
>
> I use cgywin windows  and notepad ++.
>
>
> Can anyone help?
>
>
> Thanks,
>
> Subashini.K
>
>
>
> ________________________________
> From: gromacs.org_gmx-users-bounces at maillist.sys.kth.se <
> gromacs.org_gmx-users-bounces at maillist.sys.kth.se> on behalf of Mark
> Abraham <mark.j.abraham at gmail.com>
> Sent: Tuesday, February 28, 2017 2:31 PM
> To: gmx-users at gromacs.org
> Subject: Re: [gmx-users] ERROR IN BASH SCRIPTING
>
> Hi,
>
> Looks like you edited on Windows last. Use dos2unix now, or a proper text
> editor next time ;-)
>
> Mark
>
> On Tue, 28 Feb 2017 08:14 Subashini .K <subashinik at hotmail.com> wrote:
>
> > Hi gromacs users,
> >
> >
> > I use the following run.sh in the working directory of simulations
> >
> >
> > #!/bin/bash
> > set -e
> >
> > for ((i=0;i<27;i++)); do
> >
> >     x=$(echo "0.05*$(($i+1))" | bc);
> >
> >     sed 's/WINDOW/'$x'/g' mdp/min.mdp > grompp.mdp
> >     gmx grompp -o min.$i -pp min.$i -po min.$i -n index.ndx
> >     gmx mdrun -deffnm min.$i -pf pullf-min.$i -px pullx-min.$i
> >
> >     sed 's/WINDOW/'$x'/g' mdp/min2.mdp > grompp.mdp
> >     gmx grompp -o min2.$i -c min.$i -t min.$i -pp min2.$i -po min2.$i
> > -maxwarn 1 -n index.ndx
> >     gmx mdrun -deffnm min2.$i -pf pullf-min2.$i -px pullx-min2.$i
> >
> >     sed 's/WINDOW/'$x'/g' mdp/eql.mdp > grompp.mdp
> >     gmx grompp -o eql.$i -c min2.$i -t min2.$i -pp eql.$i -po eql.$i -n
> > index.ndx
> >     gmx mdrun -deffnm eql.$i -pf pullf-eql.$i -px pullx-eql.$i
> >
> >     sed 's/WINDOW/'$x'/g' mdp/eql2.mdp > grompp.mdp
> >     gmx grompp -o eql2.$i -c eql.$i -t eql.$i -pp eql2.$i -po eql2.$i -n
> > index.ndx
> >     gmx mdrun -deffnm eql2.$i -pf pullf-eql2.$i -px pullx-eql2.$i
> >
> >     sed 's/WINDOW/'$x'/g' mdp/prd.mdp > grompp.mdp
> >     gmx grompp -o prd.$i -c eql2.$i -t eql2.$i -pp prd.$i -po prd.$i -n
> > index.ndx
> >     gmx mdrun -deffnm prd.$i -pf pullf-prd.$i -px pullx-prd.$i
> >
> > done
> >
> > However, I get the following error
> >
> >
> >  ./run.sh
> > : invalid option: set: -
> > set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
> > ./run.sh: line 3: $'\r': command not found
> > ./run.sh: line 4: syntax error near unexpected token `$'do\r''
> > '/run.sh: line 4: `for ((i=0;i<27;i++)); do
> >
> >
> > How to fix it?
> >
> >
> > Thanks,
> >
> > Subashini.K
> >
>
> --
> Gromacs Users mailing list
>
> * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> posting!
>
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> send a mail to gmx-users-request at gromacs.org.
>


More information about the gromacs.org_gmx-users mailing list