问题 I am writing a bash program that takes options. For example : ./my_program -l 3 -a -s -l 3 will limit the output to three lines -a will select all my file -s will sort the output For now, I could use two options at a time this way: if [ $all == 1 ] then if [ $sort == 1 ] then printf '%s\n' "${haikus[@]}" | sed -e 's/^[ \t]*//' | sort else printf '%s\n' "${haikus[@]}" | sed -e 's/^[ \t]*//' fi fi If -a option, I print the whole file, or, if -a option and -s option, I use the same command but i