textbox2

来自「This version of dialog, formerly known a」· 代码 · 共 48 行

TXT
48
字号
#!/bin/sh# $Id: textbox2,v 1.2 2003/08/15 19:40:37 tom Exp $: ${DIALOG=dialog}tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$trap "rm -f $tempfile" 0 1 2 5 15cat << EOF > $tempfileHi, this is a text dialog box. It can be used to display text from a file.The file should not contain any 'tab' characters, so you should 'expand'the file first if it contains 'tab' characters.It's like a simple text file viewer, with these keys implemented:PGDN/SPACE     - Move down one pagePGUP/'b'       - Move up one pageENTER/DOWN/'j' - Move down one lineUP/'k'         - Move up one lineLEFT/'h'       - Scroll leftRIGHT/'l'      - Scroll right'0'            - Move to beginning of lineHOME/'g'       - Move to beginning of fileEND/'G'        - Move to end of file'/'            - Forward search'?'            - Backward search'n'            - Repeat last search (forward)'N'            - Repeat last search (backward)The following is a sample text file:EOFTEXT=/usr/share/common-licenses/GPLtest -f $TEXT || TEXT=../COPYINGcat $TEXT | expand >> $tempfile$DIALOG --clear --title "TEXT BOX" --textbox "$tempfile" 0 0case $? in  0)    echo "OK";;  255)    echo "ESC pressed.";;esac

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?