1
我試圖在這裏實現一些非常簡單的事情,但缺少一些東西。Bash:Path with
我想通過bash腳本(.sh)創建一個文件。
當我直接終端上我嘗試:
touch /Users/luco/Downloads/My\ Test\ Folder/test.txt
它創建.txt文件沒有問題。但是,當我直接嘗試我的腳本時:
#!/bin/sh
clear
touch "$1"/test.txt
它不起作用。給我這個消息:
.../test.txt: No such file or directory
我打電話這種方式的腳本:
./Script.sh "/Users/luco/Downloads/My\ Test\ Folder/"
./Script.sh /Users/luco/Downloads/My\ Test\ Folder/
無工作。
我在做什麼錯?
在此先感謝。
你是如何調用腳本? – chepner
如果將它作爲'./the_script/Users/luco/Downloads/My \ Test \ Folder'運行會怎麼樣? – Arkku
在您的問題中給出的腳本沒有表現出所述的問題。 –