Description
The compile and linking helper `tsxs', shipped with traffic server fails to recognize command line switches if they are supplied out of order:
root@test1:~/build-area/example/session-1# tsxs -o session.so -c session-1.c compiling session-1.c -> session-1.lo compiling -> gcc: argument to '-o' is missing Compile failed: gcc -I/usr/include -fpic -c -o root@test1:~/build-area/example/session-1# tsxs -c session-1.c -o session.so compiling session-1.c -> session-1.lo linking -> session.so
This happens because the script triggers immediate action if a switch is encountered while parsing the command line. A better approach would be to parse the command line first and handle later.
Since this is a reasonable small script I'd offer to redo it in Perl in a cleaner way if you want to get rid of that limited shell code.