我在这个脚本中做错了什么?
#!/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
Run Code Online (Sandbox Code Playgroud)
该脚本给出了这些错误:
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
Run Code Online (Sandbox Code Playgroud)
我缺少某种转义序列吗?我已经尝试使用 \ 来转义 …