Re: [gmx-users] How to use "echo" to output index file with only one command line?

2019-02-11 Thread lucioric

Hello. try:
echo -e "r 1-442\nq\n" | gmx make_ndx -f equilibration.gro
If this does not work, try:
gmx make_ndx -f equilibration.gro<

Re: [gmx-users] How to use "echo" to output index file with only one command line?

2019-02-11 Thread Pedro Deira
For a one command line in bash I would use

printf "r 1-442 \n q \n" | command

In echo it is similar but you need to work out the " and ' very carefully.

Cheers,


On Mon, 11 Feb 2019, 17:21 ZHANG Cheng <272699...@qq.com wrote:

> Dear Pedro Deira,
>
>
> Sorry, could you please show me how to include the newline using "echo"
> with only one command line?
>
>
> Yours sincerely
> Cheng
>
>
>
>
> -- Original --
> From:  "ZHANG Cheng"<272699...@qq.com>;
> Date:  Mon, Feb 11, 2019 06:36 AM
> To:  "gromacs.org_gmx-users";
>
> Subject:  How to use "echo" to output index file with only one command
> line?
>
>
>
> I can successfully output the index file by doing it step by step:
>
>
> $ gmx make_ndx -f equilibration.gro
> $ r 1-442
> $ q
>
>
> But I am not sure how to do it in just one line.
>
>
> I tried these but all could not work
>
>
> $ echo r 1-442 q | gmx make_ndx -f equilibration.gro
> $ echo "r 1-442" q | gmx make_ndx -f equilibration.gro
> $ echo "r 1-442" "q" | gmx make_ndx -f equilibration.gro
>
>
> Thank you!
> --
> 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-requ...@gromacs.org.
>
-- 
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-requ...@gromacs.org.


Re: [gmx-users] How to use "echo" to output index file with only one command line?

2019-02-11 Thread Mark Abraham
Hi,

Like

echo "r 1-442\nq" | gmx make_ndx -f equilibration.gro

The "\n" is the code for a new line.

Mark

On Mon, 11 Feb 2019 at 18:22 ZHANG Cheng <272699...@qq.com> wrote:

> Dear Pedro Deira,
>
>
> Sorry, could you please show me how to include the newline using "echo"
> with only one command line?
>
>
> Yours sincerely
> Cheng
>
>
>
>
> -- Original --
> From:  "ZHANG Cheng"<272699...@qq.com>;
> Date:  Mon, Feb 11, 2019 06:36 AM
> To:  "gromacs.org_gmx-users";
>
> Subject:  How to use "echo" to output index file with only one command
> line?
>
>
>
> I can successfully output the index file by doing it step by step:
>
>
> $ gmx make_ndx -f equilibration.gro
> $ r 1-442
> $ q
>
>
> But I am not sure how to do it in just one line.
>
>
> I tried these but all could not work
>
>
> $ echo r 1-442 q | gmx make_ndx -f equilibration.gro
> $ echo "r 1-442" q | gmx make_ndx -f equilibration.gro
> $ echo "r 1-442" "q" | gmx make_ndx -f equilibration.gro
>
>
> Thank you!
> --
> 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-requ...@gromacs.org.
>
-- 
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-requ...@gromacs.org.


Re: [gmx-users] How to use "echo" to output index file with only one command line?

2019-02-11 Thread ZHANG Cheng
Dear Pedro Deira,


Sorry, could you please show me how to include the newline using "echo" with 
only one command line?


Yours sincerely
Cheng




-- Original --
From:  "ZHANG Cheng"<272699...@qq.com>;
Date:  Mon, Feb 11, 2019 06:36 AM
To:  "gromacs.org_gmx-users";

Subject:  How to use "echo" to output index file with only one command line?



I can successfully output the index file by doing it step by step:


$ gmx make_ndx -f equilibration.gro
$ r 1-442
$ q


But I am not sure how to do it in just one line.


I tried these but all could not work


$ echo r 1-442 q | gmx make_ndx -f equilibration.gro
$ echo "r 1-442" q | gmx make_ndx -f equilibration.gro
$ echo "r 1-442" "q" | gmx make_ndx -f equilibration.gro


Thank you!
-- 
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-requ...@gromacs.org.


Re: [gmx-users] How to use "echo" to output index file with only one command line?

2019-02-10 Thread Pedro Deira
You need to include the newlines in your echo to get the result you want.

Cheers


On Sun, 10 Feb 2019, 22:38 ZHANG Cheng <272699...@qq.com wrote:

> I can successfully output the index file by doing it step by step:
>
>
> $ gmx make_ndx -f equilibration.gro
> $ r 1-442
> $ q
>
>
> But I am not sure how to do it in just one line.
>
>
> I tried these but all could not work
>
>
> $ echo r 1-442 q | gmx make_ndx -f equilibration.gro
> $ echo "r 1-442" q | gmx make_ndx -f equilibration.gro
> $ echo "r 1-442" "q" | gmx make_ndx -f equilibration.gro
>
>
> Thank you!
> --
> 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-requ...@gromacs.org.
>
-- 
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-requ...@gromacs.org.


[gmx-users] How to use "echo" to output index file with only one command line?

2019-02-10 Thread ZHANG Cheng
I can successfully output the index file by doing it step by step:


$ gmx make_ndx -f equilibration.gro
$ r 1-442
$ q


But I am not sure how to do it in just one line.


I tried these but all could not work


$ echo r 1-442 q | gmx make_ndx -f equilibration.gro
$ echo "r 1-442" q | gmx make_ndx -f equilibration.gro
$ echo "r 1-442" "q" | gmx make_ndx -f equilibration.gro


Thank you!
-- 
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-requ...@gromacs.org.