Topic Options
#37165 - 09/28/18 05:28 PM How to set a variable using system command
Antoniel Gomes Offline
Forum Member

Registered: 09/13/18
Posts: 3
Hello,

Is there a way to set a variable as result of system command?

For example:
set home = system "echo house"

Checking:
echo @home

Result:
house


Regards.

Top
#37166 - 09/29/18 12:26 PM Re: How to set a variable using system command [Re: Antoniel Gomes]
rmv Online   content

Forum Member

Registered: 09/17/03
Posts: 8259
Loc: 39 03 48 N, 77 06 54 W
Yes, but indirectly through a file:

system "echo house > /tmp/file.txt"
open unit 2 read card name /tmp/file.txt
get home unit 2


Note that any text will become all upper case.
_________________________
Rick Venable
computational chemist


Top
#37167 - 10/01/18 03:07 PM Re: How to set a variable using system command [Re: rmv]
Antoniel Gomes Offline
Forum Member

Registered: 09/13/18
Posts: 3
Thank you.
I was trying to do that directly in charmm to don't write any file.

Regards.

Top

Moderator:  John Legato, lennart