On Tue, Feb 18, 2014 at 06:38:42PM +0000, Chris Walker wrote:
On Tue, 18 Feb 2014 18:28:43 +0000 Chris Green cl@isbd.net wrote:
I think I'd do something like the following, on the command line with no scripts:-
for fn in *.vcf do cat "$fn" >>listfile echo >>listfile echo >>listfile done
You can type it just as I have listed it above as the shell will prompt for the intermediate lines with a '>' until you enter the line with 'done'.
OK. I've followed your instructions and I do indeed end up with a listfile comprising all the vcf entries.
But I don't understand why it works so can you explain it for me please? The problem I have is why am I running the echo line twice?
The 'for' executes everything between the 'do' and the 'done' for each .vcf file. The 'cat' does what you know, I put quotes round the file name to make it work with filenames that have embedded spaces. 'echo' just outputs what's after it, which in the above case is nothing except for CR/LF (end of line). I just did two echoes to give you two blank lines.