# join pairs of lines side-by-side (like "paste")
sed '$!N;s/\n/ /'
The above script comes from the great list of sed one-liners found on sourceforge.
I wish to use it in an a bash script but it has no effect if used inside the script. If I pipe the output of the script through it, it joins join pairs of lines side-by-side as described.
Some character must need escaping but I just can't "see" which character needs to be escaped to make it work inside a bash script.
Yoroshiku Onegaishimasu!
Later..
#!/bin/bash
# numbers.sh
for X in 1 2 3 4 5 6 7 8 9 0
do
echo $X
done
When used this script:
#!/bin/bash
./numbers.sh | sed '$!N;s/\n/ /'
works fine..
1 2
3 4
5 6
7 8
9 0
Please let me regroup my thoughts on this..
Later...
I found the logical error in the script which broke it.