sed/awk, instead of Perl

Steve Bertrand steve at
Thu Aug 21 13:00:49 UTC 2008

Joseph Olatt wrote:

> Try the following:
>  cat t.txt | awk -F\t '{split($1, arr, "."); printf("%s_%s@%s\n", arr[
> 1], arr[2], $2);}'
> where t.txt:
> john.doe

This did the job, the only modification I needed to make was manually 
replace $2 with the string of the domain I needed it changed to.


Thanks everyone for such quick responses!


More information about the freebsd-questions mailing list