I want to call external application from shell script, but this shell script gets parameters (from other script) in a single variable. All was OK until I did not have to use
Answering my own question. BIG thanks goes to pzanoni. xargs seems to parse correctly anything you are throwing to it :-) "$@", "$", $@ and $ works good with it. So my code now looks like:
#!/bin/sh
pass() {
echo $* | xargs ./sh_param
}
pass '"single param" separate params'
And result is what I wanted:
Param: single param
Param: separate
Param: params