cleanup
[cmdllinux.git] / scripts / _print_last_char.sh
blob8cfd28ff4d3a6cfe0e64920e1143e4f96d97d8e9
1 [ -z "$1" ] && exit 1
2 FILE="$1"
3 [ ! -f "$FILE" ] && exit 2
5 SIZE=`stat -c '%s' "$FILE"`
6 retval=$?
7 [ "$retval" != 0 ] && exit $retval
9 [ "$SIZE" -lt 1 ] && exit 0
11 FEND=`od -v -A n -t x1 -N 1 -j $(expr $SIZE - 1) "$FILE"`
12 retval=$?
13 [ "$retval" != 0 ] && exit $retval
15 echo $FEND