File: special-expansions.sh

package info (click to toggle)
devscripts 2.23.4%2Bdeb12u2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,228 kB
  • sloc: perl: 26,224; sh: 11,330; python: 3,880; makefile: 350; ansic: 11
file content (26 lines) | stat: -rw-r--r-- 433 bytes parent folder | download | duplicates (13)
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
#!/bin/sh

set -- foo bar moo

echo BASHISM: ${#@}
echo BASHISM: ${#*}

echo BASHISM: ${@%f*}
echo BASHISM: ${*%f*}
echo BASHISM: ${@%%f*}
echo BASHISM: ${*%%f*}

echo BASHISM: ${@#*o}
echo BASHISM: ${*#*o}
echo BASHISM: ${@##*o}
echo BASHISM: ${*##*o}

echo BASHISM: ${@/?/u}
echo BASHISM: ${*/?/u}
echo BASHISM: ${@/?/}
echo BASHISM: ${*/?/}

echo BASHISM: ${@:2}
echo BASHISM: ${*:2}
echo BASHISM: ${@:1:1}
echo BASHISM: ${*:1:1}