DataMuseum.dk

Presents historical artifacts from the history of:

Regnecentalen RC-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Regnecentalen RC-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦d16c1b6f4⟧ TextFile

    Length: 2820 (0xb04)
    Types: TextFile
    Notes: UNIX file
    Names: »check.SHELL«

Derivation

└─⟦bee8f15db⟧ Bits:30004169/disk2.imd Uniplex II+ V.6 release 1.0 (dansk)
└─⟦bee8f15db⟧ UNIX Filesystem
    └─⟦this⟧ »up/new/usr/UAP/install.cmds/check.SHELL« 

TextFile


: '
install.cmds/check.SHELL

Usage:  check.SHELL

Exits:  0 - OK
        1 - SHELL is not fully Bourne shell compatible
            Error message displayed.

This program is designed to catch out non-standard SHELLs,
such as the HP/UX (HP 9000/300) and AIX (2.1) ones
L..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T..T.R.
'

BAD="Standard system utility \"sh\" does not operate correctly$BELL
"
WARN="WARNING: $BAD"
BAD="ERROR: $BAD"
PAUSE=

: "case" statement checks

for F in a aa aaa; do
   case "$F" in
      ?*) ;;
     ??*) ;;
    ???*) ;;
       *) echo "$BAD(CASE statement doesn't process \"?\")"
          exit 1
          ;;
   esac
done

A=A
case "$A" in
   *A* ) ;;
     * ) echo "$BAD(CASE statement doesn't process \"*A*\" matching)"
         exit 1
         ;;
esac

case "$A" in
   [Aa]) ;;
      *) echo "$BAD(CASE statement doesn't process \"[Aa]\" matching)"
         exit 1
         ;;
esac

case "$A" in
 *[Aa]*) ;;
      *) echo "$BAD(CASE statement doesn't process \"*[Aa]*\" matching)"
         exit 1
         ;;
esac

case A in
 *$A*  ) ;;
      *) echo "$BAD(CASE statement doesn't process \"*\$VAR*\" matching)"
         exit 1
         ;;
esac

for F in 'ABCD' 'Abcde' 'xA' 'EDCBABCDE'; do
   case "$F" in
    'A'*) ;;
 "$A"bc*) ;;
    ?'A') ;;
   *'A'*) ;;
       *) echo "$WARN(CASE statement doesn't process" \
               "quoting mechanism correctly)"
          PAUSE=yes
          ;;
   esac
done

F=''
case "$F" in
 '') ;;
  *) echo "$WARN(CASE statement doesn't recognise null strings)"
     PAUSE=yes
     ;;
esac

: while/done exit code tests

echo a |
while read F; do
        :
done
case $? in
   0) ;;
   *) echo "$BAD(WHILE statement doesn't exit correctly on EOF)"
      exit 1
      ;;
esac

echo a |
while read F; do
        exit 1
done
case $? in
   0) echo "$BAD(WHILE statement doesn't pass embedded EXIT code)"
      exit 1
      ;;
esac

: checks for parameter substitution

case ${Pe=A}B in
   'AB') ;;
      *) echo "$WARN(Parameter substitution does not work correctly for
\${parameter=value}continue  when parameter is not set in the environment)"
         PAUSE=yes
         ;;
esac

Pe=
: Pe is now set

case ${Pe=A}B in
   'B') ;;
      *) echo "$WARN(Parameter substitution does not work correclty for
\${parameter=value}continue  when parameter is set in the environment but has
null value)"
         PAUSE=yes
         ;;
esac

Pe=C
: Pe is set and contains 'C'

case ${Pe=A}B in
   'CB') ;;
      *) echo "$WARN(Parameter substitution does not work correclty for
\${parameter=value}continue  when parameter is set and has a defined value)"
         PAUSE=yes
         ;;
esac

: If any WARNings above, elicit an extra RETURN before clean exit

case "$PAUSE" in
  y*) echo "Press <RETURN> to continue"; read ans;;
esac

exit 0