-
Notifications
You must be signed in to change notification settings - Fork 0
/
CODING__ReportDirsScriptLocations.sh
82 lines (71 loc) · 2.03 KB
/
CODING__ReportDirsScriptLocations.sh
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/sh
##############################################################################################
###
### $Id: CODING__ReportDirsScriptLocations.sh,v 1.1 2024/09/11 18:35:11 root Exp $
###
### Report list of directories where system-oriented scripts can be found,
### having the filename form *.sh, *.bash, *.ash, *.ksh, *.zsh, *.csh
###
##############################################################################################
BASE=`basename "$0" ".sh" `
START=`pwd`
FILES="${START}/${BASE}.files"
DIRS="${START}/${BASE}.dirs"
rm -f ${FILES}
rm -f ${DIRS}
INDEX="${index:-/DB001_F2/LO_Index}"
cd ${INDEX}
grep -v '^/usr' INDEX.allDrives.f.txt |
grep -v '[a-zA-Z0-9]/OasisMega1.UPDATE/' |
grep -v '[a-zA-Z0-9]/OasisMega1.DISTRO/' |
grep -v '[a-zA-Z0-9]/OasisMega2.UPDATE/' |
grep -v '[a-zA-Z0-9]/OasisMega2.DISTRO/' |
grep -v '[a-zA-Z0-9]/OasisMidi.UPDATE/' |
grep -v '[a-zA-Z0-9]/OasisMidi.DISTRO/' |
grep -v '[a-zA-Z0-9]/OasisMini.UPDATE/' |
grep -v '[a-zA-Z0-9]/OasisMini.DISTRO/' |
grep -v '[a-zA-Z0-9]/usr/src/linux-' |
grep -v '[a-zA-Z0-9]/usr/share/' |
grep -v '[a-zA-Z0-9]/usr/lib/' |
grep -v '^/bin' |
grep -v '^/var' |
grep -v '^/etc' |
grep -v '^/lib' |
grep -v '^/sys' |
grep -v '^/srv' |
grep -v '^/run' |
grep -v '^/opt' |
grep -v '^/sbin' |
grep -v '^/proc' |
grep -v '^/snap' |
grep -v '^/boot' |
grep -v '^/local' |
grep -v '^/mount' |
grep -v '^/media' |
grep -v '^/local' |
grep -v '^/Local' |
grep -v '^/cdrom' |
grep -v '^/debian' |
grep -v '^/CloneBackup' > "${FILES}.tmp"
grep '\.sh$' "${FILES}.tmp" >"${FILES}"
grep '\.bash$' "${FILES}.tmp" >>"${FILES}"
grep '\.ash$' "${FILES}.tmp" >>"${FILES}"
grep '\.ksh$' "${FILES}.tmp" >>"${FILES}"
grep '\.zsh$' "${FILES}.tmp" >>"${FILES}"
grep '\.csh$' "${FILES}.tmp" >>"${FILES}"
cat ${FILES} |
awk -F/ '{
if( index( $NF, ":" ) != 1 ){
for( i=1 ; i <= NF-1 ; i++){
printf("%s/", $i ) ;
} ;
print "" ;
} ;
}' |
sort -r |
uniq |
awk '{ if( $1 != "/" ){ print $0 } ; }' >${DIRS}
wc -l ${FILES} ${DIRS}
exit 0
exit 0
exit 0