File: check-bash-lang

package info (click to toggle)
drbl 5.7.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 6,984 kB
  • sloc: sh: 43,522; perl: 8,820; xml: 867; makefile: 131
file content (19 lines) | stat: -rwxr-xr-x 553 bytes parent folder | download | duplicates (17)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
# A script to check if the variables are OK for bash shell script.
if [ -z "$(echo "$LANG" | grep -iE "(UTF-8|utf8)")" ]; then
  echo "This program must be run in UTF-8 environment!"
  echo "Now the environment variable LANG is: $LANG"
  echo "Program terminated!"
  exit 1
fi
prog="$(basename $0)"
for i in ./*; do
  nm="$(basename $i)"
  [ "$nm" = "$prog" ] && continue
  # BIG5 is the only exception. Skip it.
  [ -n "$(echo $nm | grep -i big5)" ] && continue
  # skip dir
  [ -d "$nm" ] && continue
  echo "Checking $nm..."
  . $nm
done