source: nutchez-0.1/bin/test.sh @ 66

Last change on this file since 66 was 66, checked in by waue, 15 years ago

NutchEz - an easy way to nutch

  • Property svn:executable set to *
File size: 1.0 KB
Line 
1#!/bin/sh
2# $Id: inputbox4,v 1.3 2004/09/12 22:38:08 tom Exp $
3# An example which does not use temporary files, as suggested by Cary Evans:
4
5: ${DIALOG=dialog}
6$DIALOG --msgbox "goood" 0 0
7$DIALOG --msgbox "goood1" 0 0
8$DIALOG --msgbox "goood2" 0 0
9
10
11
12tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
13trap "rm -f $tempfile" 0 1 2 5 15
14
15$DIALOG --cr-wrap \
16  --title "INPUT BOX" --clear \
17        --inputbox \
18"Hi, this is an input dialog box. You can use
19this to ask questions that require the user
20to input a string as the answer. You can
21input strings of length longer than the
22width of the input box, in that case, the
23input field will be automatically scrolled.
24You can use BACKSPACE to correct errors.
25
26Try entering your name below:" 0 0 2> $tempfile
27
28retval=$?
29
30case $retval in
31  0)
32    #echo "Input string is `cat $tempfile`"
33    $DIALOG --msgbox "Your message is `cat $tempfile`" 0 0
34    ;;
35  1)
36    echo "Cancel pressed.";;
37  255)
38    if test -s $tempfile ; then
39      cat $tempfile
40    else
41      echo "ESC pressed."
42    fi
43    ;;
44esac
Note: See TracBrowser for help on using the repository browser.