ã ãã¶åã®è©±ãPerlã使ããªãã§Shellã¹ã¯ãªããã§é å¼µã£ã¦ããé ãShellã§ã³ãã³ãã©ã¤ã³ãªãã·ã§ã³ã®è§£æãããæ㯠#!/bin/sh for OPT in $* do case $OPT in '-x' ) FLAG_X="TRUE" ;; '-y' ) shift FLAG_Y="TRUE" VALUE_Y=$1 ;; esac shift done if [ "$FLAG_X" = "TRUE" ]; then echo "Option -x specified." fi if [ "$FLAG_Y" = "TRUE" ]; then echo "Option -y $VALUE_Y specified." fi ã¨ããæã㧠$* 㨠shift ã使ã£ã¦ãã£ã¦ããã®ã§ãããæè¿ getopts ãªãç´ æµãªãã«ãã¤ã³ã³ãã³ããç¥ãã¾ãããããã使ãã¨ä¸ã®ã¹ã¯ãªããã¯ä¸ã®ã
{{#tags}}- {{label}}
{{/tags}}