22
voglio chiamare uno script bash come questoargomenti parse dopo getopts
$ ./scriptName -o -p -t something path/to/file
Questo è quanto ho
#!/bin/bash
o=false
p=false
while getopts ":opt:" options
do
case $options in
o) opt1=true
;;
p) opt2=true
;;
t) opt3=$OPTARG
;;
esac
done
ma come faccio ad avere il path/to/file
?
Potrebbe essere scritta la prima riga 'shift $ ((OPTIND - 1))' - cioè perdere il simbolo del dollaro tra parentesi? – Armand
Armand, quindi sembra come per: http://www.tldp.org/LDP/abs/html/arithexp.html –