79607414

Date: 2025-05-05 18:02:40
Score: 0.5
Natty:
Report link

I did the "hardwork" going through all special characters in ERE,PERL (I hope)

in /usr/local/bin/ssed

#!/bin/sh

file="$1"

if [ -n "$file" ]; then
  sed "s#[@/\^.$|()[*+?{}\#,&=:~]\|-\|\]#\\\&#g" "$file"
else
  sed "s#[@/\^.$|()[*+?{}\#,&=:~]\|-\|\]#\\\&#g"
fi

Example Usage:

$ grep '^[^#]' mirrorlist | ssed | xargs -d'\n' -I{} sed -i '/{}/ s/#//' mirrorlist.pacnew 

In this case I needed to go through all urls in mirrorlist.pacnew and uncomment those which are in mirrorlist uncommented.

Reasons:
  • Blacklisted phrase (0.5): I need
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: daru