简体   繁体   中英

|+ operators in getops of ksh

What is difference when we use |+ operator in getopts of ksh ?

Examples of code are

while getopts d: o
do  case "$o" in
    d|+d)   seplist="$OPTARG";;
    esac
done

echo $seplist

and

while getopts d: o
do  case "$o" in
    d)  seplist="$OPTARG";;
    esac
done

echo $seplist

The operator | means or , so d|+d) means d or +d .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM