PageRenderTime 11ms CodeModel.GetById 2ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/contrib/dialog/samples/msgbox4-utf8

https://bitbucket.org/freebsd/freebsd-head/
Shell | 37 lines | 27 code | 8 blank | 2 comment | 2 complexity | ccad1977e0d1e89f22919b7da6d81d4f MD5 | raw file
 1#!/bin/sh
 2# $Id: msgbox4-utf8,v 1.10 2010/01/13 10:20:03 tom Exp $
 3
 4. ./setup-vars
 5
 6. ./setup-utf8
 7
 8width=30
 9while test $width != 61
10do
11$DIALOG --title "MESSAGE BOX (width $width)" --no-collapse "$@" \
12        --msgbox "\
13This sample is written in UTF-8.
14There are several checking points:
15(1) whether the fullwidth characters are displayed well or not,
16(2) whether the width of characters are evaluated properly, and
17(3) whether the character at line-folding is lost or not.
18
19あいうえおかきくけこさしすせそたちつてとなにぬねの
201234567890123456789012345
21ABCDEFGHIJKLMNOPQRSTUVWXY
22
23Hi, this is a simple message box.  You can use this to \
24display any message you like.  The box will remain until \
25you press the ENTER key." 22 $width
26retval=$?
27
28case $retval in
29  $DIALOG_CANCEL)
30    echo "Cancel pressed.";exit;;
31  $DIALOG_ESC)
32    echo "ESC pressed.";exit;;
33esac
34
35width=`expr $width + 1`
36
37done