]> git.ipfire.org Git - thirdparty/bash.git/blob - tests/alias.tests
bash-5.1 distribution sources and documentation
[thirdparty/bash.git] / tests / alias.tests
1 # This program is free software: you can redistribute it and/or modify
2 # it under the terms of the GNU General Public License as published by
3 # the Free Software Foundation, either version 3 of the License, or
4 # (at your option) any later version.
5 #
6 # This program is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 # GNU General Public License for more details.
10 #
11 # You should have received a copy of the GNU General Public License
12 # along with this program. If not, see <http://www.gnu.org/licenses/>.
13 #
14 # place holder for future alias testing
15 shopt -s expand_aliases
16
17 # alias/unalias tests originally in builtins.tests
18
19 unalias -a
20 # this should return success, according to POSIX.2
21 alias
22 echo alias: $?
23 alias foo=bar
24 unalias foo
25 # this had better return success, according to POSIX.2
26 alias
27 echo alias: $?
28
29 # bug in all versions through bash-2.05b
30
31 unalias qfoo qbar qbaz quux 2>/dev/null
32
33 alias qfoo=qbar
34 alias qbar=qbaz
35 alias qbaz=quux
36 alias quux=qfoo
37
38 qfoo
39
40 unalias qfoo qbar qbaz quux
41
42 unalias -a
43
44 alias foo='echo '
45 alias bar=baz
46 alias baz=quux
47
48 foo bar
49
50 unalias foo bar baz
51
52 ${THIS_SH} ./alias1.sub
53 ${THIS_SH} ./alias2.sub
54 ${THIS_SH} ./alias3.sub
55 ${THIS_SH} ./alias4.sub
56 ${THIS_SH} ./alias5.sub