linux - Concatenate and change extension -


i'm trying concatenate files 1.txt , 2.txt, , several html files. i'm trying save them .php after concatenation after. i've tried follows, doesn't work.

step 1:

sudo find . -name "*.html" -type f -exec ./code.sh {} \; 

code.sh

cat 1.txt $1 2.txt > mv $1 `echo $1 | sed 's/\.html/.php/'`;  

any ideas how solve this?

your problem you're trying write file called mv along other parameters.

i think mean code.sh is:

cat 1.txt $1 2.txt > $(echo $1 | sed 's/\.html/.php/') 

Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -