From: Steven Baltakatei Sandoval Date: Sat, 31 Dec 2022 15:20:53 +0000 (+0000) Subject: feat(user/regex-backslash.sh):Add script to escape regex chars X-Git-Tag: 0.6.0~2 X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/commitdiff_plain/c3c5720e1e742e389fdfab3091b3c397e98ddade?ds=inline;hp=--cc feat(user/regex-backslash.sh):Add script to escape regex chars --- c3c5720e1e742e389fdfab3091b3c397e98ddade diff --git a/user/regex-backslash.sh b/user/regex-backslash.sh new file mode 100755 index 0000000..3a850d6 --- /dev/null +++ b/user/regex-backslash.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# Desc: Backslashes regex special characters +# Usage: cat file.txt | regex-backslash.sh +# Version: 0.0.1 +# Depends: sed (GNU sed) 4.8; GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu) +# Ref/Attrib: [1] TIL: Reading stdin to a BASH variable https://dev.to/jeremyckahn/til-reading-stdin-to-a-bash-variable-1kln + +STD_IN=$(