Basically I need to run the script with paths related to the shell script file location, how can I change the current directory to the same directory as where the script file resides?
Basically I need to run the script with paths related to the shell script file location, how can I change the current directory to the same directory as where the script file resides?
引数で複数のロングオプションを指定したい時のgetoptの指定の仕方がよくわからなかったので、 調べたり実験したりしてみた結果↓で出来るようになりました。 実行コマンド batch/sample.sh --target=maker --env=stage コード OPT=`getopt -o "" -l target: -l env: -- "$@"` if [ "$?" -ne 0 ]; then error "Usage: $0 [--target VALUE] [--env VALUE]" fi eval set -- "$OPT" until [ "$1" == "--" ]; do echo $1 case $1 in --target) target=$2 ;; --env) env=$2 ;; esac shift done echolog log "target is :
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く