1 #*********************************************************************
2 # Subroutime to output error messages to STDERR. Quoted strings *
3 # are passed on the command and output as separate lines. *
4 # *
5 # The bell or other signal is activiated first. 1st line preceeded *
6 # with the program name, others are not. The ^G is actually Cntl-G. *
7 #*********************************************************************
8 emsg()
9 {
10
11 echo "^G\c" 1>&2 # Ring the bell if output is to a terminal, no NL
12
13 if [ $# -gt 0 ]
14 then
15 echo "$progname: $1" 1>&2
16 shift 1
17 while [ $# -gt 0 ]
18 do
19 echo "$1" 1>&2
20 shift 1
21 done
22 fi
23
24 } # End of emsg subroutine #06
|
The progname variable would be set elsewhere with something like progname=`/bin/basename "$0"`