I actually have a script to bundle up two files but i don't know how it works .Can someone please explain.
Here's the script:-
for i do echo "echo $i 1>&2" echo "cat >$i <<'End of $i'" cat $i echo "End of $i" done
now suppose i pass two regular files as parameters :
$>chmod 777 bundle.sh $>./bundle.sh file1 file2>new.sh $>chmod 777 new.sh $>./new.sh file1 file2
The above is teh output as shown here we redirect the output to new.sh file and on executing that file we end up bundling the two files
Can somebody please explain what's going on in here?