Sublime Forum

Bash syntax highlight fail on dd syntax

#1

Hi guys.

I just discovered a syntax highlight bug in a bash script syntax. The problem apparently is that the if= flag of dd is being confused with a if statement.

A simple test code is:

dd bs=446 count=1 if=/dev/sdX 2>/dev/null |sum|awk '{print $1}'

Best regards.

0 Likes

#2

Update: I make it a plugin here https://packagecontrol.io/packages/ShellScriptImproved


You may try this one.

0 Likes

#3

How can I patch ST3 with this?

0 Likes

#4
  1. Menu Bar > Preferences > Browse Packages
  2. Create a directory named ShellScript
  3. Go into the ShellScript directory
  4. Create a file named Shell-Unix-Generic.sublime-syntax
  5. Copy and patse https://raw.githubusercontent.com/jfcherng/Packages/fix-shell/ShellScript/Shell-Unix-Generic.sublime-syntax to Shell-Unix-Generic.sublime-syntax
  6. Maybe restart your ST

To uninstall this, just delete the ShellScript directory.

It looks like this on my ST.

0 Likes

#5

It worked beautifully. Many thanks, Jack!

0 Likes