Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
UNIX でスクリプトを作成する必要があります。
次のように呼び出すと:
./check -l word1 -c word2,
コマンド -l および -c で使用される単語をスクリプト内から取得する必要があります。
getopts次のスクリプトに示すように使用します。
getopts
#!/bin/bash while getopts l:c: option do case "$option" in l) loption="$OPTARG" ;; c) coption="$OPTARG" ;; esac done echo "L is: $loption" echo "C is: $coption"