How can I print variables to an output file in two or more columns (using echo
for example). I have the following:
grep -oP 'value\s*=\s*\K.*' file >x_vs_y # x values
for X in $(seq 0 50 400)
do
echo "$X" >>x_vs_y # y values
done
Output: (x_vs_y)
1.08759432363
1.08477216702
1.08211988431
1.07947977045
1.07685185457
1.07423631941
1.07163282502
1.06904156798
1.06646245052
0
50
100
150
200
250
300
350
400
With this script I get an output file in a single column (18x1), but I want to get a 9x2 array (X vs Y) like:
Output: (x_vs_y)
1.08759432363 0
1.08477216702 50
1.08211988431 100
1.07947977045 150
1.07685185457 200
1.07423631941 250
1.07163282502 300
1.06904156798 350
1.06646245052 400
$(seq
just an example or the actual requirement? This is important to know to select the right tool. Maybe readman paste
if this is what you are looking for.