#! /bin/bash for (( l = 1 ; l <= 50; ++l )) ; do for (( k = 1 ; k <= 1000; ++k )) ; do sed -n '$l,$lp' $k.dat >> ~/Escritorio/$l.txt done done
The script is located in a folder together with 1000 dat files each one having 50 lines of text.
The dat files are called
My purpose is to make files
l.txt has the l line of
1.dat, the l line of
2.dat, etc. For that, I use the
sed command to select the l file of each dat file.
But when I run the above script, the txt created have nothing inside...
Where is the mistake?