]> git.decadent.org.uk Git - ion3.git/blob - utils/ion-runinxterm
[svn-inject] Installing original source of ion3
[ion3.git] / utils / ion-runinxterm
1 #!/bin/sh
2
3 test "$XTERMCMD" || XTERMCMD="xterm"
4
5 title=""
6 wait=""
7
8 while test $# -ge 0; do
9     if test "$1" = "--"; then
10         shift
11         break
12     elif test "$1" = "-phase2"; then
13         shift
14         "$@" && test "$wait" = "" || {
15             echo "Press enter..."
16             read nothing
17         }
18         exit
19     elif test "$1" = "-T"; then
20         if test $# -lt 2; then
21             echo error
22             exit 0
23         fi
24         title="$2"
25         shift 2
26     elif test "$1" = "-w"; then
27         wait="$1"
28         shift
29     else
30         break
31     fi
32 done
33
34 if test $# -lt 1; then
35     echo error
36     exit 0
37 fi
38
39 if test "$title" = ""; then
40         title="$*"
41 fi
42
43 exec $XTERMCMD -T "$title" -e $0 $wait -phase2 "$@"