Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ./my_program --option1 --option2 --option3
- use_option3=1 # or 0
- option3=""
- if [ $use_option3 == 1 ]; then
- option3="--option3"
- fi
- ./my_program --option1 --option2 "$option3"
- opts=(--option1 --option2)
- if [[ $use_option3 == 1 ]]; then
- opts+=(--option3)
- fi
- ./my_program "${opts[@]}"
Add Comment
Please, Sign In to add comment