I have the following code. In all cases I'm expecting to get 1 1
. Could someone explain why I do not get the expected output in the first case?
The question seems to be very simple and I think I'm missing something basic.
Thanks in advance.
#!/bin/bash
f(){
echo $1
}
ff(){
echo $1 $1
}
# expecting 1 1, but got empty
f 1 | ff
# ok
X=$(f 1)
ff $X