I have a file with numbers in like this:
1234 5678 3456 How can I get this on one line using a bash shell script with a space between each like this
1234 5678 3456 I have a file with numbers in like this:
1234 5678 3456 How can I get this on one line using a bash shell script with a space between each like this
1234 5678 3456 The easiest way is to use xargs. e.g.
xargs < file.txt echo "$x + 1" | bc else echo "Invalid number" fi