BASH - regex in a case statement
Hi, the following works and BASH doesn't complain, but VIM highlights the closing square bracket is if it sees a syntax error. Is there a better way to express regex in a case statement or is this an issue with VIM?
Code:
#!/bin/bash |
Is it highlighted only when you're on it or the open bracket? Vim likes to highlight matching pairs like that. On my system I see it highlight both the open and the close when I'm on either - there is a difference in the bold for the one I'm on as opposed to its match but both are highlighted.
|
Yes, same here. When a bracket is selected, VIM highlights it with a flashing yellow/teal and the matching bracket with teal, but in this case it's highlighting the closing square bracket in red, without the opening or closing square brackets selected.
I've seen this before when I'd use a bashism in a script that starts with #!/bin/sh instead of #!/bin/bash so it definitely looks like it's trying to alert me to a syntax error.. |
Vim can occasionally get syntax highlighting wrong. Shell is definitely not the easiest language to parse.
|
All times are GMT -5. The time now is 08:46 AM. |