請問關於linux下的腳本問題



贊助商連結


chrisdar
2005-05-20, 09:31 AM
使用者目錄式 /home/test
目前在 ~/mytest 下有兩個檔案
第一個是 myput.txt 內容是
open -u anonymous,anonymous -p 21 127.0.0.1
lcd /home/test/tmp
mput -c *.*
第二個是 test.sh 內容是
#!/bin/bash
lftp -f ./myput.txt

然後在指令模式 的 ~/mytest 目錄下
下達 lftp -f myput.txt 正常
下達 sh test.sh 他說找不到檔案

這該如何解決

贊助商連結


raytracy
2005-05-20, 11:23 AM
是 sh 說找不到檔案? 還是 lftp 說找不到檔案? 請先用 which 找出 lftp 的完整路徑, 然後在 test.sh 內加入 lftp 的完整路徑試試看....另外 myput.txt 也改用完整路徑, 不要只用 ./myput.txt

linux_xp
2005-05-20, 04:16 PM
chmod +x test.sh
./test.sh