[esp-r] Re: bash script, clm module problem

olivier bounhoure olivier.bounhoure at gmail.com
Thu Dec 12 22:16:29 GMT 2013


Dear Dimitrios,

The prj module really call a new process where you cannot interact from
your main script. I suggest a workaround: hacking the *.cfg file through
your bash script.

#!/bin/bash
for CLIMATE in /home/dsfakianakis/Elyros/ClimateFiles/*.clm
   do
   CFG_FILE=Elyros_$( basename $CLIMATE .clm ).cfg
   sed -e "s#^\*clm .*#*clm $CLIMATE#" < Elyros.cfg > $CFG_FILE
   done

This will create as many *.cfg file as you have *.clm files. You can then
play with each of them.

I hope you will find this convenient.
Best regards,

Olivier Bounhoure


2013/12/12 Dimitrios Sfakianakis <dimitrios.sfakianakis at strath.ac.uk>

> Dear List,
>
> I am currently developing a bash script to automate a process. I'm opening
> the file in text mode and when selecting a different climate file, the clm
> module opens in a new window (a new command line where clm is in text
> mode). In this new command line the commands in my script are not executed.
>
> Has anyone encountered this problem? Do you know if it's possible to input
> in this new command window?
>
> Here is the script. The problem appears on the 12th line.
>
> #!/bin/bash
>
> for i in `ls /home/dsfakianakis/Elyros/ClimateFiles/*.clm`
> do
>
> prj -mode text -file Elyros.cfg << XZZ
> b
> a
> b
> <
> $i
> #at this point the clm module open in a new window and I have to manually
> close it for the script to continue.
>
> -
> y
> y
> -
> -
> XZZ
>
> done
>
>
> Thanks again for the support!!
>
> Kind regards,
>
> Dimitrios Sfakianakis MEng
> Research Assistant, Dept. Naval Architecture and Marine Engineering,
> University of Strathclyde
> Kelvin Hydrodynamics Laboratory, Acre Road, Glasgow, G20 0TL
> T: +44 (0) 141 330 2648 (Ext 2648)
> M: +44 07514271592
> E: dimitrios.sfakianakis at strath.ac.uk
> The University of Strathclyde is a charitable body, registered in
> Scotland, with registration number SC015263.
>
> _______________________________________________
> esp-r mailing list
> esp-r at lists.strath.ac.uk
> http://lists.strath.ac.uk/mailman/listinfo/esp-r
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.strath.ac.uk/archives/esp-r/attachments/20131212/e5ab3687/attachment.html 


More information about the esp-r mailing list