tags:

views:

17

answers:

1

I've been told I can concatenate files in a sort of batch file by using sh.

e.g.

cat file1 file2 >> file3

cat file1 file4 >> file5

Is it possible to do a string replacement, I mean load file, replace x with y and run the file with sh.

+1  A: 

The 'sed' utility, the stream editor, is the shell tool to do this. You could do something like the following to do what you asked, join file1 and file2, change all occurances of x to y and then run the commands with the bash shell:

cat file1 file2 | sed -e 's/x/y/g' | bash
verisimilidude