This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if [[ " ${array[@]} " =~ " ${value} " ]]; then | |
| # whatever you want to do when arr contains value | |
| fi | |
| ------------------------------------------------------ | |
| if [[ ! " ${array[@]} " =~ " ${value} " ]]; then | |
| # whatever you want to do when arr doesn't contain value | |
| fi | |
| ------------------------------------------------------ | |
| if [[ " ${!array[@]} " =~ " ${value} " ]]; then | |
| # whatever you want to do when arr contains value |
NewerOlder