hi friends.
yo i have a textfile with url�s in it
sometimes middle in text, sometimes one url alone is a line
i append a string right behind the domain name
so that http://unix.com becomes http://unix.com.APPENDTHIS on all occasions.
i use this sed-line to achieve this:
sed -i "s/http:\/\/[a-zA-Z0-9\_\-\.]*/&.APPENDTHIS/g" FILE
now my problem is when the url contains a dash it messes up.
test input file:
http://alf.com/super.cgi
http://frederick.xoom.com/homepage/xy.htm
http://james_007.web1000.com/
http://unix-windows.com/bluescreen.txt
http://alf.com.APPENDTHIS/super.cgi
http://frederick.xoom.com.APPENDTHIS/homepage/xy.htm
http://james_007.web1000.com.APPENDTHIS/
http://unix.APPENDTHIS-windows.com/bluescreen.txt
the last url with the - dash in it messes up. it appends "APPENDTHIS" after the dash instead there where the domain-name ends.
what do i do wrong?
i tried to unescaped dash and double escaped also.
thanks for the needed kick.