-
Notifications
You must be signed in to change notification settings - Fork 87
/
remove-lists
executable file
·40 lines (31 loc) · 974 Bytes
/
remove-lists
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
#!/usr/bin/env bash
#
# remove-all-lists
#
# Remove files that contain all entries for a particular category and/or folder
#
# Written by: [decal {AT} sdf {D0T} org]
# Last Modified: Fri Nov 11 02:06:36 EST 2016
# Tested On: Kali GNU/Linux Rolling
# See Also: create-all-lists
#
[ -f shared/colors ] && source shared/colors
[ -f scripts/shared/colors ] && source scripts/shared/colors
if [ ! -d webapp-files ]
then cd ..
if [ ! -d webapp-files ]
then echo -e "${blackfg}${yellowbg}***${reset} ${yellow}Try running this script from the git repository root or bin directory!${reset}"
exit 1
else
cd webapp-files
fi
else
cd webapp-files
fi
declare -a file_exts=$( ls -1 -- *.txt | awk -F- '{print($1);}' )
for w in ${file_exts[*]}
do rm -i -f -- ./${w}-all.txt
done
rm -i -f -- ./all.txt
echo -e "${blackf}${greenb}***${reset} ${greenf}Finished removing ${boldon}'all'${boldoff} (concatenated/sorted/uniqifed) text files.."
exit 0