Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

[Solved] Help with grep script

$
0
0
Hi,
I'm having trouble with a script to copy one line out of multiple files in a directory and copy to a file called test. I've tried the code below but it copies one line out of the first file multiple times not one line out of all the files. Would someone help? I'm very new to all this.

Many thanks,
Bob

Code:

#!/bin/bash
for i in *.CSV
do
    sed -n '10p' *.CSV >> test
done


Viewing all articles
Browse latest Browse all 16232

Trending Articles