Take quoted output from one script as quoted input for another script

Hi,

I have a script output.sh which produces the following output (as an example):
"abc def" "ghi jkl"

This output should be handled from script input.sh as input and the quotes should be treated as variable delimiters but not as regular characters.

input.sh (processing positional parameters)

  VAR1=$1
  VAR2=$2
  echo $VAR1
  echo $VAR2

If I do this one: input.sh `output.sh`
I get this result:
"abc
def"

But that's not exactly what I hoped to see:
abc def
ghi jkl

How can I make Script input.sh to handle the output of output.sh as needed, i. e. by using the delivered quotes as variable delimiters?

Thanks in adance,
Stephan.

Try this...

./output.sh | xargs ./input.sh

--ahamed

1 Like

Oh, yes, sometimes life can be really easy! :slight_smile: But sometimes I can't see the wood for the (christmas) trees... :wall:

Thank you!

Stephan