The following command pretends to be the most complicated simple command in Shell, without escape sequences, quoted expressions, word expansions and the rest of Shell grammar but simple commands.
The command itself is commented out and described below in a more readable script. The command or its parts could be of use for an interview quiz, for instance, as it touches all the relevant tokens specified by the standard and several non-obvious interpretations.
The command itself is commented out and described below in a more readable script. The command or its parts could be of use for an interview quiz, for instance, as it touches all the relevant tokens specified by the standard and several non-obvious interpretations.
#0>& 1 >&- X= 2>>-3- =X= 4<<-5- =X 6<>7 8>|9 0<& 1 <& - CMD="=X=" ARG="=X" ERRFILE="-3-" IOFILE="7" OUTFILE="9" X="" $CMD $ARG 2>>$ERRFILE 6<>$IOFILE 8>|$OUTFILE 4<<- 5- Here-document starts. This is a sample text. That's it. 5-