Off topic:Bash for loop help please
0
0
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

bash linux • 1.2k views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 1960 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6