I have numbers from 1 to 1000 in file ($y).
for i in {1..1000}
do
echo "$i" >> $y
done
I want to split numbers into two column in the file(user enters the filename that indicates "$y").
1 501
. .
. .
500 1000
like this.
I tried ‘split -l500 $y’ and ‘column -t ‘ command but couldnt get result.
>Solution :
What I would do:
printf '%d\t%d\n' {1..100}
1 2
3 4
5 6
[...]
Then:
printf '%d\t%d\n' {1..100} | while read i; do
echo "$i" >> "$y"
done