blob: efbdef35c2d7ff1132dbbd306c366ee3db74bdec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
set -- 0123456
echo "all |"$1
echo "4: |"${1:4}
echo "4:2 |"${1:4:2}
echo "4:-1 |"${1:4:-1}
echo "4:-2 |"${1:4:-2}
echo "4:-3 |"${1:4:-3}
echo "-4: |"${1: -4}
echo "-4:2 |"${1: -4:2}
echo "-4:-1 |"${1: -4:-1}
echo "-4:-2 |"${1: -4:-2}
echo "-4:-3 |"${1: -4:-3}
echo "-4:-4 |"${1: -4:-4}
i=2; echo "-4:i=2 |"${1: -4:i}
i=-2; echo "-4:i=-2|"${1: -4:i}
i=-3; echo "-4:i=-3|"${1: -4:i}
i=-4; echo "-4:i=-4|"${1: -4:i}
echo "-5: |"${1: -5}
echo "-6: |"${1: -6}
echo "-7: |"${1: -7}
echo "-8: |"${1: -8}
echo "-9: |"${1: -9}
echo "-9:-99 |"${1: -9:-99}
echo Ok:$?
|