Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add wild cards to text

Status
Not open for further replies.

dsm666

IS-IT--Management
Mar 9, 2004
40
US
We are moving to a new version of web washer and I need to add * to the begining and at the end of our white list.
the list just contains URL's.
example instead of cisco.com it should be *cisco.com*

Thanks in advance.
 
Hi

Code:
sed 's/.*/*&*/' /whitelist/file > /new/file

[gray]# or[/gray]

awk '$0="*"$0"*"' /whitelist/file > /new/file

[gray]# or[/gray]

while read -r s; do echo "*$s*"; done < /whitelist/file > /new/file

Feherke.
 
So awesome used the last command and it worked perfectly. Thank you so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top