看板
[ Linux ]
討論串[問題] shell script -- getopt 問題
共 3 篇文章
首頁
上一頁
1
下一頁
尾頁
內容預覽:
getopt要如何正確處理含有空白的arg?. 以下是小弟的script. test.sh. #!/bin/bash. args=`getopt a:b: $*`. if [ $? -ne 0 ]; then. echo error. exit 1. fi. set -- $args. while
(還有191個字)
內容預覽:
總共有三個地方要做修正. 1. 把參數傳給 getopt 要加上正確的引號,. 請參考 man bash 有關 "$*" "$@". 2. 原版 getopt 並不處理空白或其他特殊字元,. 必須啟動 getopt 的加強版功能,. 請參考 man getopt 有關 COMPATIBILITY 一
(還有270個字)
首頁
上一頁
1
下一頁
尾頁