From 60052659b98832c78c902e4f27ecee2663d8e913 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Wed, 6 May 2026 08:30:49 +0200 Subject: Added scripts --- scripts/urlgrep | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 scripts/urlgrep (limited to 'scripts/urlgrep') diff --git a/scripts/urlgrep b/scripts/urlgrep new file mode 100755 index 0000000..49afac6 --- /dev/null +++ b/scripts/urlgrep @@ -0,0 +1,9 @@ +#!/bin/sh + +# Find all URLs in stdin, print them newline-separated to stdout + +protocols='http|https|ftp|sftp|gemini|mailto' +valid_chars="][a-zA-Z0-9_~/?#@!$&'()*+=.,;:-" +regex="(($protocols):|www\.)[$valid_chars]+" + +egrep -o "$regex" -- cgit v1.3