What am I doing wrong in this script?
#!/bin/bash cat > /tmp/flash-viewer.htm <<- _EOF_ <HTML><HEAD><TITLE>Flash Viewer</TITLE></HEAD><BODY> <object width=\"1280\" height=\"720\" data=\"$1\"></object> </BODY></HTML> _EOF_ if [ -n $BROWSER ]; then $BROWSER '/tmp/flash-viewer.htm' elif which xdg-open > /dev/null; then xdg-open '/tmp/flash-viewer.htm' elif which gnome-open > /dev/null; then gnome-open '/tmp/flash-viewer.htm' else echo "Could not detect the web browser to use." fi
The script gives these errors:
joe@U13:~/Script$ ./html-flash-viewer.sh "/home/joe/video.swf" /tmp/flash-viewer.htm: line 1: <HTML><HEAD><TITLE>Flash: command not found /tmp/flash-viewer.htm: line 2: <object: command not found /tmp/flash-viewer.htm: line 3: </BODY></HTML>: No such file or directory
Is there some kind of escape sequence I'm missing? I've already tried using \ to escape the LT/GT brackets and enclosing the html in single and double quotes. Each produces similar errors.