1 | #!/usr/bin/env bash |
2 | # |
3 | # Test chained and/or. |
4 | |
5 | # From Aboriginal sources/download_functions.sh. |
6 | noversion() |
7 | { |
8 | LOGRUS='s/-*\(\([0-9\.]\)*\([_-]rc\)*\(-pre\)*\([0-9][a-zA-Z]\)*\)*\(\.tar\(\..z2*\)*\)$' |
9 | [ -z "$2" ] && LOGRUS="$LOGRUS//" || LOGRUS="$LOGRUS/$2\\6/" |
10 | |
11 | echo "$1" | sed -e "$LOGRUS" |
12 | } |
13 | |
14 | |
15 | # Simplified version. |
16 | simple() { |
17 | [ -z "$1" ] && LOGRUS="yes" || LOGRUS="no" |
18 | } |
19 | |
20 | test-simple() { |
21 | simple 1 |
22 | echo $LOGRUS |
23 | simple '' |
24 | echo $LOGRUS |
25 | } |
26 | |
27 | "$@" |