I have a file like this:
1
2
3
I need to copy data n times with an empty line after each copy. I used these commands
#!/bin/sh
num=$(sed -n '1 p' FILE.txt)
for i in {1.. $num }; do cat distance_k.txt >> distance.txt; done
n is a number taken from another file 'FILE.txt' (FILE.txt have form like this :
90
Abcbaahjfh
...
However, it copied only 4 times. Could you please help me? Thank you so much!
bash shell
Output
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
...