åºæï¼é£ã°ãã¦ããï¼ ã¾ã話ã¯åãæ¸ãã¦ãã¹ã¯ãªããã§ãå¼æ°ãã"æå¾ã®"å¤ã ããåé¢ãããã®ã使ãããã£ãã£ã¦ã®ãå§ã¾ãã§ãã æåã®å¼æ°ã®åé¢ãªã shift ã§ããããã ããæå¾ããããªãåé¢ããã®ãç´æ¥ã¯åºæ¥ãªãã£ã½ãã®ã§ãæ ¼éã®çµæ以ä¸ã®ããã«è§£æ±ºãã¾ããã #!/bin/sh ARGS=("$@") echo "æå¾ä»¥å¤: ${ARGS[@]:0:((${#ARGS[@]}-1))}" echo "æå¾ã®ã¿: ${ARGS[((${#ARGS[@]}-1))]}" echo "æå¾ã®ã¿: ${ARGS[-1]}" # bash-4.2 以éãªãè² ã®ã¤ã³ããã¯ã¹ã使ãã! 以ä¸ãä¸è¨ã¹ã¯ãªããã®å®è¡çµæã§ãã $ ./test.sh a b c d æå¾ä»¥å¤: a b c æå¾ã®ã¿: d ãã£ã¦ãããã¨ã¯ãã¾ãå¼æ°ãARGVã¨ããé åå¤æ°ã«è©°ããªããã¦ããã®å¾é åå¤æ°ã«å¯¾ããã¹ã©
{{#tags}}- {{label}}
{{/tags}}