Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

The "@" symbol actually creates a lot of headaches in scripting.

Script,

Code Block
languagebash
#!/bin/bash

perl -p -i -e "s/\@gmail.com/000/g" in.txt
perl -p -i -e "s/\@google.com/000/g" in.txt
perl -p -i -e "s/\@hotmail.com/000/g" in.txt
perl -p -i -e "s/\@rogers.com/000/g" in.txt

grep "\@" in.txt  | wc -l

Input File,

Code Block
clark.kent@rogers.com, clark.kent@gmail.com
lois.lane@rogers.com
perry.white@spam.org, jimmy.olsen@gmail.com, lois.lane@gmail.com