Bash中不区分大小写的比较

问题描述:

我正在尝试在不区分大小写的while语句中编写比较.基本上,我只是想简化以下内容,以便对用户显示是或否的问题提示...

I'm trying to write a comparison in a while statement that's case insensitive. Basically, I'm simply trying to shorten the following to act on a yes or no question prompt to the user ...

while[ $yn == "y" | $yn == "Y" | $yn == "Yes" | $yn == "yes" ] ; do

解决这个问题的最佳方法是什么?

What would be the best way to go about this?