#!/bin/sh # Sample script for scdaemon event mechanism. #exec >>/tmp/scd-event.log PGM=scd-event reader_port= old_code=0x0000 new_code=0x0000 status= tick='`' prev= while [ $# -gt 0 ]; do arg="$1" case $arg in -*=*) optarg=$(echo "X$arg" | sed -e '1s/^X//' -e 's/[-_a-zA-Z0-9]*=//') ;; *) optarg= ;; esac if [ -n "$prev" ]; then eval "$prev=\$arg" prev= shift continue fi case $arg in --help|-h) cat <&2 exit 1 ;; *) break ;; esac shift done if [ -n "$prev" ]; then echo "$PGM: argument missing for option $tick$prev'" >&2 exit 1 fi cat <&1 fi