jeudi 19 octobre 2017

how to substitute and print column in perl just like in awk

I have this bash/awk code to deal with hosts

$ echo 'the.pattern to change' | awk '{sub(/the./,"")}{print $1}'
pattern

I would need to replace awk by perl. Any idea how to replace the second part of the statement by perl oneliner?

Aucun commentaire:

Enregistrer un commentaire