ariable as a character string. For example, if filename has the value fred.c, then ${#filename} would have the value 6.
The other operator ... variable normally read from the command-line arguments, when no such arguments are given. This is shown in the following script:
#!/bin/ba... variable normally read from the command-line arguments, when no such arguments are given. This is shown in the following script:
<code>#!/...
The construct ${variable##*/} is actually equivalent to the UNIX utility basename(1). basename takes a pathname as argument and returns the filename only; it is meant to be
mpty: zmore "" arg2 arg3
then
echo "Usage: `basename $0` filename" >&2
# Error message to stderr.
exit $E_NO... t (error code).
fi
filename=$1
if [ ! -f "$filename" ] # Quoting $filename allows for possible spaces.
then
echo "File $filename not found!" >&2 # Error message to stderr.
exit $E_NOTFOUND
fi
if [ ${f