Skip to content

Commit

Permalink
HARDER
Browse files Browse the repository at this point in the history
  • Loading branch information
NotaInutilis committed Sep 4, 2023
1 parent afd6d06 commit 35fd830
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@
# e.g.
# ./scripts/update.sh

# Cleanup sources.
# Remove `www.` from sources.
find ./sources -type f -name "*.txt" -exec sed -i 's/^www\.//i' {} \;

# Remove duplicates from each source file.
find ./sources -type f -name "*.txt" -exec bash -c '
cat -n "$0" | sort -uk2 | sort -nk1 | cut -f2- > "$0.temp";
mv "$0.temp" "$0";
' {} \;

# Combine all sources into `domains.txt`.
find ./sources -type f -name "*.txt" -exec cat {} \; > sources.txt
sed -i '/^#/d; s/#.*//; /^ *$/d' sources.txt
Expand Down
9 changes: 9 additions & 0 deletions sources/eng/test2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# I'm testing!
example.com # bad website
www.example.com




#
EXAMPLEUZ.www.COM# FARTS

0 comments on commit 35fd830

Please sign in to comment.