sh-beginning-of-command

sh-beginning-of-command is a variable defined in `sh-script.el'.
Its value is

"\\([;({`|&]\\|\\`\\|[^\\]\n\\)[ ]*\\([/~[:alnum:]:]\\)"

  • This variable may be risky if used as a file-local variable.

Documentation:
Regexp to determine the beginning of a shell command.
The actual command starts at the beginning of the second \(grouping\).

You can customize this variable.