I have two scripts which transform the code from software v.1
to software v.2
and viceversa. These are essentially a lot of sed
substitutions.
In the way I wrote them they accept two arguments: first, the input file , and second the output file.
$ ./transform2new oldfile newfile
or
$ ./transform2old newfile oldfile
I'd like to merge both codes and manage the transformation with a flag, e.g,
$ ./transform -n oldfile newfile
$ ./transform -o newfile oldfile
Question
How could I write a single script to achieve the purpose?
Cheers.