If I understand your problem correctly (which I'm not sure about, see my comment), you should probably add another \n to your printf ; printf does not add a trailing newline by default, as echo does. This ensures that the second value is correctly read by the select command, which I assume will appear in export_map.sh .
printf "$nav\n$enc\n" | /bin/bash -c "./export_map.sh \"100 200 300 400\""
Also, I don't think you need to add the /bin/bash -c and quote tags. The following is enough: if I am missing something:
printf "$nav\n$enc\n" | ./export_map.sh "100 200 300 400"
edit Thanks for the clarification. To pass an argument from your script shell to an internal script, saving it as a single argument, you can pass "$1" where the quotation marks indicate that you want to keep this group as a single argument, and $1 is the first parameter in your script wrapper. If you want to transfer all parameters from an external script to your internal script, each of which is stored as one parameter, you can use " $@ " instead.
#!/bin/bash for nav in 1 2 3 4; do for enc in 1 2; do printf "$nav\n$enc\n" | ./export_map.sh "$1" done done
Here is a brief example of how " $@ " works. First, inner.bash :
#!/bin/bash for str in " $@ " do echo $str done
outer.bash :
#!/bin/bash ./inner.bash " $@ "
And calling him:
$ ./outer.bash "foo bar" baz "quux zot" foo bar baz quux zot
source share