Shell: #!/bin/sh: No such file or directory PHP: Warning: Cannot modify header information – headers already sent
在详细讨论UTF-8编码中BOM的检测与删除问题前,不妨先通过一个例子热热身:
shell> curl -s http://phone.jb51.net/ | head -1 | sed -n l \357\273\277!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional\ //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r$
for FILE in $FILES; do if $SVNLOOK cat -t "$TXN" "$REPOS" "$FILE" | grep -q $'^\xEF\xBB\xBF'; then echo "Byte Order Mark be found in $FILE" 1>2 exit 1 fi done