This is obviously an SSCCE, so it makes (in itself) no sense. E.g. the variable assignment to
Y is not used in this minimal example; I'm just trying to figure out the correct syntax to use for my actual case.
I can do the following directly on the bash shell:
Y=10 echo foo
I can also have the following in a bash file
#!/bin/bash X="echo foo" $X
... and then do a:
However, when I have the following in a bash file:
#!/bin/bash X="Y=10 echo foo" $X
... then, I get:
$ ./foo.sh ./foo.sh: line 3: Y=10: command not found
What's the correct syntax to use for the above?