22
Quiero llamar a un script bash como estoargumentos de análisis sintáctico después getopts
$ ./scriptName -o -p -t something path/to/file
Esto es por lo que yo entiendo
#!/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
pero ¿cómo puedo obtener el path/to/file
?
¿Se podría escribir la primera línea 'shift $ ((OPTIND - 1))' - es decir, perder el signo de dólar dentro de los paréntesis? – Armand
Armand, por lo que parece según: http://www.tldp.org/LDP/abs/html/arithexp.html –