~emersion/mrsh

ref: 46a4cb45517fc478b00f745b904bbd10c8df8f10 mrsh/test/word.sh -rw-r--r-- 513 bytes
46a4cb45Simon Ser shell/task/word: substitute null in case no word is given 2 years ago
                                                                                
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
30
31
32
33
#!/bin/sh

echo ""
echo "Tilde Expansion"
echo ~ ~/stuff # ~"/stuff"
echo ~root
#a=~/stuff
#echo $a

echo ""
echo "Parameter Expansion"
a=a
b=B
hello=hello
null=""
echo $a ${b} ">$a<"
echo \$a '$a'
echo ${a:-BAD} ${idontexist:-GOOD} ${null:-GOOD} ${idontexist:-}
echo ${a-BAD} ${idontexist-GOOD} ${null-BAD} ${null-}
#echo ${#hello}

echo ""
echo "Command Substitution"
echo $(echo asdf)
echo `echo asdf`

echo ""
echo "Arithmetic Expansion"
#echo $((1+2))

# Field Splitting
# Pathname Expansion
# Quote Removal