InterviewSolution
| 1. |
How Do I Represent Control-codes Or Nonprintable Characters? |
|
Answer» Several versions of sed support the notation xHH, where "HH" are two hex digits, 00-FF: ssed, GNU sed v3.02.80 and above, GNU sed v1.03, sed16 and sed15 (HHsed). Try to use one of those versions. Sed is not intended to process binary or object code, and files which contain nulls (0x00) will USUALLY generate errors in most versions of sed. The latest versions of GNU sed and ssed are an EXCEPTION; they permit nulls in the input files and also in regexes. On Unix platforms, the 'echo' COMMAND may allow INSERTION of octal or hex values, e.g., `echo "nnn"` or `echo -n "nnn"`. The echo command may also support syntax like '\b' or '\t' for backspace or tab characters. Check the MAN pages to see what syntax your version of echo supports. Some versions support the following: # replace 0x1A (32 octal) with ASCII letters Several versions of sed support the notation xHH, where "HH" are two hex digits, 00-FF: ssed, GNU sed v3.02.80 and above, GNU sed v1.03, sed16 and sed15 (HHsed). Try to use one of those versions. Sed is not intended to process binary or object code, and files which contain nulls (0x00) will usually generate errors in most versions of sed. The latest versions of GNU sed and ssed are an exception; they permit nulls in the input files and also in regexes. On Unix platforms, the 'echo' command may allow insertion of octal or hex values, e.g., `echo "nnn"` or `echo -n "nnn"`. The echo command may also support syntax like '\b' or '\t' for backspace or tab characters. Check the man pages to see what syntax your version of echo supports. Some versions support the following: # replace 0x1A (32 octal) with ASCII letters |
|