File: ion-runinxterm

package info (click to toggle)
notion 4.0.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 4,656 kB
  • sloc: ansic: 47,365; sh: 2,093; makefile: 594; perl: 270
file content (43 lines) | stat: -rwxr-xr-x 693 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh

test "$XTERMCMD" || XTERMCMD="x-terminal-emulator"

title=""
wait=""

while test $# -ge 0; do
    if test "$1" = "--"; then
        shift
        break
    elif test "$1" = "-phase2"; then
        shift
        "$@" && test "$wait" = "" || {
            echo "Press enter..."
            read nothing
        }
        exit
    elif test "$1" = "-T"; then
	if test $# -lt 2; then
            echo error
            exit 0
	fi
	title="$2"
	shift 2
    elif test "$1" = "-w"; then
	wait="$1"
	shift
    else
        break
    fi
done

if test $# -lt 1; then
    echo error
    exit 0
fi

if test "$title" = ""; then
	title="$*"
fi

exec $XTERMCMD -T "$title" -e $0 $wait -phase2 "$@"