The Tab characters are more readable and maintainable when represented as a sequence of readable characters.
- In Python, it should be: "\t"
- Sed recognises \t as tab.
- In Bash, it should be: $'\t' ($'<text>' in bash: enables interpretation of backslash-quoted special characters)
Here's an example of usage of $'\t' in bash and a list of lines where the Tab character is used:
$ fgrep -Hnr $'\t' dist/s_* dist/s_copyright:21: if egrep -q "skip $1" dist/s_copyright.list; then dist/s_copyright:103: sed -e '/Makefile.in/d' \ dist/s_define:11: sed -e '/^[a-z]/!d' -e 's/[ ].*$//' -e 's,^,../,' filelist dist/s_define:34: sed 's/#define[ ][ ]*\([A-Za-z_][A-Za-z0-9_]*\).*/\1/' | dist/s_docs:89: sed -e 's/^/ /' < $t dist/s_docs:101: sed -e 's/^/ /' < $t dist/s_docs:147: sed -e 's/^/ /' < $t dist/s_docs:187: sed -e 's/^/ /' < $t dist/s_errno:58: sed -e 's/^[ ]*//' \ dist/s_funcs:13: sed -e '/^[a-z]/!d' -e 's/[ ].*$//' -e 's,^,../,' filelist dist/s_python:10:egrep ' ' `git ls-files -- '*.py'` | dist/s_python:16: sed 's/^/ /' > $t dist/s_stat:15: -e 's/[ ].*$//' \ dist/s_string:86: if ! diff $t $custom_words >/dev/null 2>&1; then dist/s_typedef:11:IFS=' '' '' dist/s_typedef:65: l=`sed -e '/^[a-z]/!d' -e 's/[ ].*$//' -e 's,^,../,' filelist` dist/s_visibility_checks:11: echo "Found invalid usage(s) of visibility check and a time aggregate window" dist/s_visibility_checks:12: echo "$found" dist/s_visibility_checks:13: exit 1 dist/s_void:232: cat $t | sed 's/^/ /' dist/s_void:256: cat $t | sed 's/^/ /'
- is related to
-
WT-12867 Clean up all Tab characters from C sources and make an s_* script to check it
- Open