Hi there,

I just installed the latest version of DX (4.2), because a saw that there
now is a better way to call script using the option -scriptcmd.

I figured out how to do it, but I have still difficulties. The scriptcmd
most be enclose with '', so the variable that are passed are not
expanded.
If figure out how to avoid this problem, but I don't think it is the
best solution. Does somebody know how to call a macro using the -scriptcmd
option with shell variables within the ''

Here is my own example
As you can to, to force variable expansion in the ScriptCmd.sh script, I
use echo to create the whole statement, and pipe that to bash.


Does anybody know a better way .??

Eelco


# a shell script which call the dx macro

################ BEGIN ScriptCmd.sh  ######################

#!/bin/bash
# a small script to test scriptcmd

# define string and number
naam="test"
numb=4

# create dx commando string
dxcmd="'ScriptCmd($naam,$numb)'"

# call dx via pipe to bash
echo -e dx -script ScriptCmd.net -scriptcmd $dxcmd |bash


################ END #####################################


# here the dx script

################ BEGIN ScriptCmd.net  ######################
# small macro to  write a string and a number to screen
macro ScriptCmd(string="test",number=34)
{
   Echo("testing......");
   Echo(string);
   Echo(number);
}
################ END  ######################

Reply via email to