我寫了一個shell腳本來使用lynx將HTML源代碼轉換爲純文本。在shell腳本中HTML到文本的轉換
這是:「未安裝Lyns」
#!/bin/sh
if [ -f = "/usr/bin/lynx" ]
then
if [ -f = "$1" ]
then
lynx -dump $1 > $2
else
echo "File $1 does not exist!"
fi
else
echo "Lynx is not installed!"
fi
現在,雖然在正確的目錄存在猞猁,和我通過正確的參數,我得到任何消息或(如果我評論第一個測試)「文件$ 1不存在!」。我不擅長sh,所以有人可以告訴我劇本有什麼問題嗎?
我認爲第二種情況也是如此。 – 2009-05-23 15:16:39
是的,當然:) – 2009-05-23 15:17:59