-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathdebug-aliases.sh
More file actions
29 lines (29 loc) · 785 Bytes
/
debug-aliases.sh
File metadata and controls
29 lines (29 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
## debug-aliases
## version 0.0.1 - initial
##################################################
shopt -s expand_aliases # expand_aliases (on)
alias mystery=test
alias big-mystery='
{
mystery $( test ! $(( RANDOM % 2 )) -eq 0 || echo "!" )
}
'
mystery
echo ${?} # 1
mystery !
echo ${?} # 0
big-mystery
echo ${?} # 0 or 1
shopt -u expand_aliases # expand_aliases (off)
mystery
echo ${?} # debug-aliases.sh: line 12: mystery: command not found
mystery !
echo ${?} # debug-aliases.sh: line 14: mystery: command not found
big-mystery
echo ${?} # 0 or 1
##################################################
## generated by create-stub2.sh v0.1.2
## on Wed, 22 May 2019 21:32:43 +0900
## see <https://github.com/temptemp3/sh2>
##################################################