Page 1 of 1

How to use simple commands to exit vi compiler after using yambo - i in shell script

Posted: Thu Mar 09, 2023 4:07 am
by Quxiao
Dear amolina:
I try to write a shell script to automatically submit yambo calculations and run them on my cluster.Some sentences are like this:

Code: Select all

yambo -i

Code: Select all

yambo

Code: Select all

yambo -r -x -p p -g n 
which is writen in the auto.sh.
However,when I run the auto.sh ,I will enter the vi compilation environment(after yambo -i or then after yambo -r -x -p p -g n),So what can I do to save and exit vi so that I can continue with the next command:yambo -r -x -p p -g n?
That puzzle me ,please give me some help
Best wishes
Quxiao

Re: How to use simple commands to exit vi compiler after using yambo - i in shell script

Posted: Thu Mar 09, 2023 7:59 am
by Daniele Varsano
Dear Quixiao,

Please note, this is neither a yambo nor a yambo-py related question.
Anyway, my suggestion here is to prepare template input files beforehand, and next handle them at your wish in the bash script.

Best,
Daniele

Re: How to use simple commands to exit vi compiler after using yambo - i in shell script

Posted: Thu Mar 09, 2023 8:58 am
by rreho
Dear Quixiao,
Daniele is right, this is not a yambo-py related question. However, my suggestion is to use yambo-py to create input files with a script. You can use the class PwIn and follow the documentation available on the Yambo Wiki.

Following your question using shell script, have you tried adding -Q at the end of the command? It works for me with Yambo 5.1.

``` yambo -i -Q ```
or

``` yambo -r -x -p p -g n -Q ```

In this way, you will create input files with flags set to their default values. I recommend editing those.

Best,
Riccardo

Re: How to use simple commands to exit vi compiler after using yambo - i in shell script

Posted: Sun Mar 26, 2023 5:54 am
by Quxiao
Dear all:
Thanks a lot for your help! -Q is very useful for my calculation.
Best wishes!
Quxiao