File: textbox

package info (click to toggle)
xdialog 2.0.6-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,616 kB
  • ctags: 1,064
  • sloc: ansic: 8,505; sh: 4,202; yacc: 318; makefile: 80
file content (32 lines) | stat: -rwxr-xr-x 588 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
DIALOG=Xdialog

cat << EOF > /tmp/textbox.tmp.$$
Hi, this is a text dialog box. It can be used to display text from a file.

It's like a simple text file viewer, with these keys implemented:

PGDN	- Move down one page
PGUP	- Move up one page
DOWN	- Move down one line
UP	- Move up one line

The following is a sample text file:


EOF

cat /etc/bashrc | expand >> /tmp/textbox.tmp.$$

$DIALOG --title "TEXT BOX" --textbox "/tmp/textbox.tmp.$$" 0 0

case $? in
  0)
    echo "OK";;
  1)
    echo "Cancel pressed.";;
  255)
    echo "Box closed.";;
esac

rm -f /tmp/textbox.tmp.$$