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