~ubuntu-branches/ubuntu/trusty/abs-guide/trusty-proposed

« back to all changes in this revision

Viewing changes to abs/case4.sh

  • Committer: Package Import Robot
  • Author(s): Sandro Tosi
  • Date: 2012-06-03 10:57:27 UTC
  • mfrom: (1.2.6)
  • Revision ID: package-import@ubuntu.com-20120603105727-rm7frl4feikr2swm
Tags: 6.5-1
* New upstream release
* debian/watch
  - updated
* debian/abs-guide.lintian-overrides
  - updated for new upstream code
* debian/control
  - bump Standards-Version to 3.9.3 (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash4
2
 
 
3
 
test_char ()
4
 
{
5
 
  case "$1" in
6
 
    [[:print:]] )  echo "$1 is a printable character.";;&       # |
7
 
    # The ;;& terminator continues to the next pattern test.      |
8
 
    [[:alnum:]] )  echo "$1 is an alpha/numeric character.";;&  # v
9
 
    [[:alpha:]] )  echo "$1 is an alphabetic character.";;&     # v
10
 
    [[:lower:]] )  echo "$1 is a lowercase alphabetic character.";;&
11
 
    [[:digit:]] )  echo "$1 is an numeric character.";&         # |
12
 
    # The ;& terminator executes the next statement ...         # |
13
 
    %%%@@@@@    )  echo "********************************";;    # v
14
 
#   ^^^^^^^^  ... even with a dummy pattern.
15
 
  esac
16
 
}
17
 
 
18
 
echo
19
 
 
20
 
test_char 3
21
 
# 3 is a printable character.
22
 
# 3 is an alpha/numeric character.
23
 
# 3 is an numeric character.
24
 
# ********************************
25
 
echo
26
 
 
27
 
test_char m
28
 
# m is a printable character.
29
 
# m is an alpha/numeric character.
30
 
# m is an alphabetic character.
31
 
# m is a lowercase alphabetic character.
32
 
echo
33
 
 
34
 
test_char /
35
 
# / is a printable character.
36
 
 
37
 
echo
38
 
 
39
 
# The ;;& terminator can save complex if/then conditions.
40
 
# The ;& is somewhat less useful.