~ubuntu-branches/ubuntu/trusty/bash/trusty-security

« back to all changes in this revision

Viewing changes to tests/shopt.tests

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-03-03 22:52:05 UTC
  • mfrom: (1.3.5) (2.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20140303225205-87ltrt5kspeq0g1b
Tags: 4.3-1ubuntu1
* Merge with Debian; remaining changes:
  - skel.bashrc:
    - Run lesspipe.
    - Enable ls aliases.
    - Set options in ll alias to -alF.
    - Define an alert alias.
    - Enabled colored grep aliases.
  - etc.bash.bashrc:
    - Add sudo hint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# let's try an error message first
 
2
shopt -z
 
3
 
 
4
# first, set up a known environment
 
5
shopt -u cdable_vars
 
6
shopt -s cdspell
 
7
shopt -u checkhash
 
8
shopt -u checkwinsize
 
9
shopt -s cmdhist
 
10
shopt -u dotglob
 
11
shopt -u execfail
 
12
shopt -s expand_aliases
 
13
shopt -u extglob
 
14
shopt -u histreedit
 
15
shopt -u histappend
 
16
shopt -u histverify
 
17
shopt -s hostcomplete
 
18
shopt -u huponexit
 
19
shopt -s interactive_comments
 
20
shopt -u lithist
 
21
shopt -u mailwarn
 
22
shopt -u nocaseglob
 
23
shopt -u nullglob
 
24
shopt -s promptvars
 
25
shopt -u shift_verbose
 
26
shopt -s sourcepath
 
27
shopt -u xpg_echo
 
28
 
 
29
# Now, start checking the output
 
30
builtin printf -- "--\n"
 
31
shopt -p        # list 'em all
 
32
builtin printf -- "--\n"
 
33
# test specific variables
 
34
shopt -p huponexit
 
35
shopt -p checkwinsize
 
36
shopt -p sourcepath
 
37
 
 
38
builtin printf -- "--\n"
 
39
shopt -s -p
 
40
builtin printf -- "--\n"
 
41
shopt -u -p
 
42
builtin printf -- "--\n"
 
43
shopt -u
 
44
 
 
45
# Now set up another known environment
 
46
set +o allexport
 
47
set -o braceexpand
 
48
set +o errexit
 
49
set -o hashall
 
50
set -o histexpand
 
51
set +o keyword
 
52
set -o monitor
 
53
set +o noclobber
 
54
set +o noexec
 
55
set +o noglob
 
56
set +o notify
 
57
set +o nounset
 
58
set +o onecmd
 
59
set +o physical
 
60
set -o privileged
 
61
set +o verbose
 
62
set +o xtrace
 
63
set -o history
 
64
set +o ignoreeof
 
65
set -o interactive-comments
 
66
set +o posix
 
67
set -o emacs
 
68
set +o vi
 
69
 
 
70
# list 'em all
 
71
builtin printf -- "--\n"
 
72
shopt -o -p
 
73
 
 
74
builtin printf -- "--\n"
 
75
set -o
 
76
builtin printf -- "--\n"
 
77
set +o
 
78
 
 
79
# test specific variables
 
80
builtin printf -- "--\n"
 
81
shopt -p -o history
 
82
shopt -p -o verbose
 
83
 
 
84
builtin printf -- "--\n"
 
85
shopt -s -p -o
 
86
builtin printf -- "--\n"
 
87
shopt -u -p -o
 
88
builtin printf -- "--\n"
 
89
shopt -u -o
 
90
 
 
91
# errors
 
92
builtin printf -- "--\n"
 
93
shopt -p xyz1
 
94
shopt -o -p xyz1