Entering edit mode
6.6 years ago
Tark
▴
50
hi everyone i want to use this command in for loop
sed 1d filename | sort -k9 -g | head -100
i am doing
#!/bin/bash
for i in `ls -v *.txt`
do
one=`sed 1d $i | sort -k9 -g|head -100`
echo $i $one >> hello.txt
done
it is giving me 100 lines from each files but each 100 lines are in one row. i want that script print 100 lines from each files and each line as separate line
please help