1 # Exit early if there is an error 2 set -e 3 4 # Store \n in a variable for use in scripts 5 LF=' 6 ' 7 8 # Quote a parameter for safe interpretation by shell 9 shell_quote() { 10 # bash has printf %q for this 11 printf '"' 12 echo -n "$*" | sed 's/\([`"$\]\)/\\\1/g;'"s/'/'\\\\''/g" 13 printf '"' 14 } 15 16 # The following is essentially to speedup sort & grep 17 # (which redhat really crippled speedwise around redhat 8/9 for UTF8 locales). 18 # Note since glibc 2.3.3 this causes (error) messages from 19 # subordinate tools to not use the charset in LC_MESSAGES. 20 # (see `info libc "Charset conversion in gettext"`). 21 export LC_CTYPE=C #uncomment for speed (noting the caveats above) 22 export LC_COLLATE=C #for even more speed 23 24 # I noticed Fedora 7 was much slower than FC4 for grep. 25 # The following change restores the faster operation. 26 # Also DFA seems more correct wrt multibyte input? 27 # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=121313 28 export GREP_USE_DFA=1 29 30 Version() { 31 echo "FSlint 2.46" && exit 32 } 33 34 check_uniq() { 35 #This uniq feature is very new (9/9/02) so check explicitly 36 echo | uniq --all-repeated=prepend > /dev/null 2>&1 || \ 37 { echo "Error: uniq must have --all-repeated=prepend option. \ 38 Get the latest version from GNU coreutils or textutils-2.0.21" >&2; exit 1; } 39 }