bash has tools for finding the file/linenumber of the caller, but it's not
POSIX, so don't rely on it.
-#!/bin/bash
+#!/bin/sh
. ./wvtest.sh
WVSTART "main test"
( set -f; echo $* )
}
-_wvfind_caller()
-{
- LVL=$1
- WVCALLER_FILE=${BASH_SOURCE[2]}
- WVCALLER_LINE=${BASH_LINENO[1]}
-}
+
+if [ -n "$BASH_VERSION" ]; then
+ _wvfind_caller()
+ {
+ LVL=$1
+ WVCALLER_FILE=${BASH_SOURCE[2]}
+ WVCALLER_LINE=${BASH_LINENO[1]}
+ }
+else
+ _wvfind_caller()
+ {
+ LVL=$1
+ WVCALLER_FILE="unknown"
+ WVCALLER_LINE=0
+ }
+fi
+
_wvcheck()
{