Hi everyone, I'd like to use the script validatehtml which returns either the given url is HTML strict or not, using http://validator.w3.org/.
sh validatehtml
#!/bin/bash
wget -q http://validator.w3.org/check?uri=$1
cat check\?uri\=$1 | sed -n '/h2/ p' | sed 's/ */ /g' | sed 's/^ //g' | sed 's/\n//' | sed 's/\(<.*>\)*\(.*\)\(<.*>\)*/\2/g'But he doesn't want to remove the newline. Can somebody help me? The sed procedures need to be in this order because the message proceeded by h2 is sometimes only 1 line, not two.
sh genscript www.w3c.org :2 lines
sh genscript www.google.com :1 linethanks guys!
I am not exactly certain what you are trying to do. The only suggestion I have is instead of using this for a new-line: \n
replace it with this and see if it helps:
\r
Otherwise, if you need more help, I suggest you post a sample data file and explain what you are trying to do.
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |