On Fri, Mar 02, 2018 at 01:05:19PM -0500, tk...@math.bu.edu wrote: > > Dear forum members, > > Is there a way to run GAP so that if one as > a .g file to execute, one can pass GAP a > particular variable setting? > > Basically I'm invoking a .g file in GAP on a batch system > for varying choices of a certain parameter and would like > to be able to use this same .g file but set different > values of this one variable at run-time? > > (i.e. I would rather not have to create multiple copies > of this .g file which are all identical except for > this variable setting.)
Hello. On Linux, one possible way is to use a shell script like the following: gap << EOF param1 := "$2"; param2 := "$3"; Read("$1"); EOF This script receives three command line parameters, the first is the name of .g script and the other are strings used to initialize GAP variables. Hope this helps. Best regards, Petr Savicky. _______________________________________________ Forum mailing list Forum@gap-system.org https://mail.gap-system.org/mailman/listinfo/forum