Debian Codegraph @

test/chk_loc.sh

raw
1 #!/bin/sh
2
3 if [ ! "$1" ]; then
4 echo "ERROR argument missing." >&2
5 echo "Usage: chk_loc.sh <locale name>" >&2
6 exit 1
7 fi
8
9 LOC=`echo $1 | sed 's/-//g'`
10
11 locale -a | sed 's/-//g' | grep -i "^${LOC}$" 2>&1 > /dev/null
12
13 if [ "$?" = "0" ]
14 then
15 echo "yes"
16 else
17 echo "no"
18 fi