Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

I can not pass parameters from bash file in routine

131 views
Skip to first unread message

Valeriu Gontia

unread,
Jun 6, 2013, 5:17:51 AM6/6/13
to
Hello everybody!
I use a script to run
my application for GT.M

#!/bin/bash
source /usr/local/gtm60/uci/salrte
mumps -r log^%ZgnMLOG

I can not pass parameters from bash file in routine
shows an error!
For example:

#!/bin/bash
source /usr/local/gtm60/uci/salrte
mumps -r log^%ZgnMLOG(parm1,parm2,parm3)

How can a positive result is achieved?

Thank you.

Alex Maslov

unread,
Jun 6, 2013, 6:18:02 AM6/6/13
to
Hello Valeriu,

What about using this pattern? :

mumps <<EOF
do log^%ZgnMLOG(parm1,parm2,parm3)
halt
EOF

Valeriu Gontia

unread,
Jun 6, 2013, 6:59:48 AM6/6/13
to
четверг, 6 июня 2013 г., 13:18:02 UTC+3 пользователь Alex Maslov написал:
And try to direct and write to the variable - not working

#!/bin/bash
# cd /usr/local/gtm60
source /usr/local/gtm60/uci/salrte
$gtm_dist/mumps -run << EOF
s par1=1959
s par2=1
s par3=15
do LOGIN^%ZgnMLOG(par1,par2,par3)
halt
EOF

I receive an error:
[root@GTM uci]# ./zsalrte
What file: %GTM-E-RUNPARAMERR, Error accessing parameter for run command
[root@GTM uci]#

Alex Maslov

unread,
Jun 6, 2013, 7:10:09 AM6/6/13
to
It seems that you should use "mumps -run" only along with some GT.M routine call, e.g. "mumps -run ^GDE". In your case "mumps -direct" should go:

$gtm_dist/mumps -direct << EOF

Valeriu Gontia

unread,
Jun 6, 2013, 7:21:55 AM6/6/13
to
четверг, 6 июня 2013 г., 14:10:09 UTC+3 пользователь Alex Maslov написал:
I like it there in the profile:
#!/bin/bash
cd /usr/local/gtm60/mgr/salrte
gtm_dist="/usr/local/gtm60"; export gtm_dist
gtmroutines="/usr/local/gtm60/mgr/salrte/r $gtm_dist ."; export gtmroutines
gtmgbldir="/usr/local/gtm60/mgr/salrte/g/database.gld"; export gtmgbldir
gtm="$gtm_dist/mumps -direct"; export gtm
mupip="$gtm_dist/mupip"; export mupip
lke="$gtm_dist/lke"; export lke
gde="$gtm_dist/mumps -r ^GDE"; export gde
dse="$gtm_dist/dse"; export dse
PATH=$PATH:$gtm_dist

Start a file that I showed:
#!/bin/bash
source /usr/local/gtm60/uci/salrte
mumps -r log^%ZgnMLOG

This is how, when I add the - no :)))

Ben Irwin

unread,
Jun 6, 2013, 7:23:55 AM6/6/13
to
This approach has worked for me.

#!/bin/bash
source /usr/local/gtm60/uci/salrte
export param1=1995
export param2=xyz
export param3=testing
mumps -r log^%ZgnMLOG

Then in the MUMPS routine:
Set param1=$ZTRNLNM("param1")
Set param2=$ZTRNLNM("param2")
Set param3=$ZTRNLNM("param3")

Valeriu Gontia

unread,
Jun 7, 2013, 12:51:18 AM6/7/13
to
четверг, 6 июня 2013 г., 14:23:55 UTC+3 пользователь Ben Irwin написал:
You can, but there are some nuances that i have yet to see...

#!/bin/bash
source /usr/local/gtm60/uci/salrte
# mumps -r log^%ZgnMLOG
mumps -r %XCMD 'd LOGIN^%ZgnMLOG(1959,1,15)'

K.S. Bhaskar

unread,
Jun 7, 2013, 1:57:51 PM6/7/13
to
Use %XCMD - it's not elegant but it works. For example:

$ mumps -run %RANDSTR^%RANDSTR
gYUqUEXT$ mumps -run %XCMD 'do %RANDSTR^%RANDSTR(8)'
0AjC5JZd$

Regards
-- Bhaskar
0 new messages