CrAcKeD bY BiSpO
CrAcKeD bY BiSpO

Reputation: 21

Use Sed or Awk to add "deny from all " to a list of IP addresses

This is probably really simple, but I'd like to find out how to add "deny from all " (with the space after "all") to a list of IP's (there are probably over 4,000).

Each line of the file contains a single IP addresses.

Upvotes: 1

Views: 138

Answers (2)

sampson-chen
sampson-chen

Reputation: 47367

Doing it with awk:

awk '{print "deny from all " $0}' < infile > outfile

Upvotes: 1

Birei
Birei

Reputation: 36282

Try (not tested):

sed -e 's/^/Deny from all /' infile

Upvotes: 3

Related Questions