The purpose of this project is to use regular expression and the sed function to automate the process of adjusting variables. Please refer to targetfile.txt as template file for the following test cases
Case1: changing the 2nd argument using comma "," as seperator, manually adding the double quotation marks around 'second!'
f0 = foo("a","b","c","d")
f0 = foo("a","second","c","d")
autosed 'foo(' '"second!"' targetfile.txt output.txt 2 ","
f1 = foo1(a,b,c,d)
f1 = foo1(a,b,third!,d)
autosed foo1\( third\! targetfile.txt output.txt 3 ","
f2 = foo2(a b c d)
f2 = foo2(999 b c d)
autosed 'foo2(' '999' targetfile.txt output.txt 1 " "
f3 = foobar( a b c d )
f3 = foobar( FIRST b c d )
autosed 'foobar( ' 'FIRST' targetfile.txt output.txt 1 " "
f3 = foobar( a b c d)
f3 = foobar( a b c d)
autosed 'foobar( ' 'FIRST' targetfile.txt output.txt 1 " "
FOOBAR:CASE=0 Foo="Foo1" Bar=0
FOOBAR:CASE=0 Foo="Foo1" Bar="BAR!"
autosed 'FOOBAR:' 'Bar="BAR!"' targetfile.txt output.txt 3 " "