看板 Linux 關於我們 聯絡資訊
我有一串指令想要用 alias 簡化 指令的順序會影響結果 指令如下 command arg_1 --message "123" --file /tmp/123.txt arg_2 其中 arg_1 , arg_2 都是固定的 但是 /tmp/123.txt 這個檔案非必要條件 command arg_1 --message "123" arg_2 這樣子也是可以的 如果我想要用 abc "123" "/tmp/123.txt" 這樣的格式下指令的話 應該要怎麼做alias ? 有沒有辦法當使用者沒有指定 /tmp/123.txt 的時候 指令就不要帶 --file 進去? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.238.51.144 (日本) ※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1669701211.A.B7B.html
rickieyang: 用 function, 不要用 alias 11/29 17:25
tonytonyjan: function 或 shebang 選一個 12/10 09:42
chang0206: 請教樓上用 shebang 的意思是? 12/12 11:33
rickieyang: Script 吧. 12/12 19:52