I try to parse my input string in a script with awk and I have encountered some limitations with multiple special characters like *** and +++.However, with the same script, with ::: or --- as delimiters, I do not have any issue.My script:input=$1delimiter=:::field2=$(echo $input | awk -F$delimiter '{print $2}')field3=$(echo $input | awk -F$delimiter '{print $3}')echo field2=$field2echo field3=$field3Output with ::: as a delimiter:bash-3.2$ ./parse_options.sh :::sub  option::: Main option, still:bla:field2=sub  optionfield3= Main option, still:bla:Now if I try to use *** as a delimiter but have other isolated * in my string, here is what I get unfortunately: the *bla* is counted as an another field and that's not what I want:bash-3.2$ ./parse_options.sh ***sub  option*** Main option, still*bla*field2=sub  optionfield3= Main option, stillAs you can see, *bla* do not appear in the third field, the delimiter set in awk is not respected in that case.And it is the same thing with +++ as a delimiter:bash-3.2$ ./parse_options.sh +++sub  option+++ Main option, still+bla+field2=sub  optionfield3= Main option, stillFor further clarifications :input=***sub  option*** Main option, still*bla*Expected output=field2=sub  optionfield3= Main option, still*bla*
Parse a string with multiple special asterisk characters
text processing;awk
#!/bin/bashinput=$1delimiter='\\*\\*\\*'field2=$(echo $input | awk -F$delimiter '{print $2}')field3=$(echo $input | awk -F$delimiter '{print $3}')echo field2=$field2echo field3=$field3$ ./parse_options.sh ***sub  option*** Main option, still*bla*field2=sub  optionfield3= Main option, still*bla*Further reading:When is double-quoting necessary?Types of quotingescaping awk field separator