lib/scripts/feeder
changeset 12111 d942348d8faf
parent 10555 2323ec838401
child 13076 70704dd48bd5
equal deleted inserted replaced
12110:f8b4b11cd79d 12111:d942348d8faf
    19   echo
    19   echo
    20   echo "  Options are:"
    20   echo "  Options are:"
    21   echo "    -h TEXT      head text"
    21   echo "    -h TEXT      head text"
    22   echo "    -p           emit my pid"
    22   echo "    -p           emit my pid"
    23   echo "    -q           do not pipe stdin"
    23   echo "    -q           do not pipe stdin"
    24   echo "    -s           filter symbols"
       
    25   echo "    -t TEXT      tail text"
    24   echo "    -t TEXT      tail text"
    26   echo
    25   echo
    27   echo "  Output texts (pid, head, stdin, tail), then wait to be terminated."
    26   echo "  Output texts (pid, head, stdin, tail), then wait to be terminated."
    28   echo
    27   echo
    29   exit 1
    28   exit 1
    41 # options
    40 # options
    42 
    41 
    43 HEAD=""
    42 HEAD=""
    44 EMITPID=""
    43 EMITPID=""
    45 QUIT=""
    44 QUIT=""
    46 SYMBOLS=""
       
    47 TAIL=""
    45 TAIL=""
    48 
    46 
    49 while getopts "h:pqst:" OPT
    47 while getopts "h:pqt:" OPT
    50 do
    48 do
    51   case "$OPT" in
    49   case "$OPT" in
    52     h)
    50     h)
    53       HEAD="$OPTARG"
    51       HEAD="$OPTARG"
    54       ;;
    52       ;;
    55     p)
    53     p)
    56       EMITPID=true
    54       EMITPID=true
    57       ;;
    55       ;;
    58     q)
    56     q)
    59       QUIT=true
    57       QUIT=true
    60       ;;
       
    61     s)
       
    62       SYMBOLS=true
       
    63       ;;
    58       ;;
    64     t)
    59     t)
    65       TAIL="$OPTARG"
    60       TAIL="$OPTARG"
    66       ;;
    61       ;;
    67     \?)
    62     \?)
    82 ## main
    77 ## main
    83 
    78 
    84 #set by configure
    79 #set by configure
    85 AUTO_PERL=perl
    80 AUTO_PERL=perl
    86 
    81 
    87 exec "$AUTO_PERL" -w "$DIR"/feeder.pl "$HEAD" "$EMITPID" "$QUIT" "$SYMBOLS" "$TAIL"
    82 exec "$AUTO_PERL" -w "$DIR"/feeder.pl "$HEAD" "$EMITPID" "$QUIT" "$TAIL"