-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathssq-ls
More file actions
57 lines (51 loc) · 873 Bytes
/
ssq-ls
File metadata and controls
57 lines (51 loc) · 873 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
#
# Synopsis:
# List queryable schemas, in no particiular order
# Usage:
# action libexeced by command "ssq ls"
#
# dirs in schema/ never a schema dir. the usual suspects.
NOT_SCHEMA='
archive
attic
bin
cache
cgi-bin
data
etc
htdocs
include
lib
libexec
log
run
sbin
spool
src
sync
tmp
var
www
'
test $# = 0 || die "wrong number of cli args: got $#, need 0"
cd schema || die "cd schema failed: exit status=$?"
FIND_OPT_IGNORE=$(
echo "$NOT_SCHEMA" |
grep -v '^ *$' |
sed 's/.*/ ! -name &/'
)
# find schema dirs containing <schema>/libexec/ssq-$SCHEMA executable
find . \
-maxdepth 1 \
-type d \
! -name . \
$FIND_OPT_IGNORE |
sed 's@\./@@' |
while read D; do
if [ -x $D/libexec/ssq-$D ]; then
echo $D
fi
done
STATUS=${PIPESTATUS[*]}
test "$STATUS" = '0 0 0'