-1

Why such script:

x=xxx
y=yyy
printf -v var "%s %s" "$x" "$y"
printf $var

prints only: xxx

While I expected: xxx yyy

How to force printf not ignore symbols after blank space?

Kenenbek Arzymatov
  • 7,359
  • 16
  • 49
  • 97

1 Answers1

0

How about

#!/bin/bash
x=xxx
y=yyy
var=`printf "%s %s" $x $y`
echo $var

?

Jan Myszkier
  • 2,652
  • 1
  • 15
  • 23