Accueil
 

GetOpt

How to handle option in bash (option with : take argument (stored in OPTARG)):

while getopts hf: opt ; do
    case "$opt" in
      f)
        FDEV="$OPTARG"
        ;;
      [?]|h)
        usage
        ;;
    esac
  done
  shift $((OPTIND-1))
 
getopt.txt · Last modified: 2008/07/17 14:19 by ctaf
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki