shellcheck icon indicating copy to clipboard operation
shellcheck copied to clipboard

'shellcheck source' can not deal with spaces (:-?)

Open Ganton opened this issue 2 years ago • 0 comments

For bugs

  • Rule Id (if any, e.g. SC1000): SC1072 and SC1073
  • My shellcheck version (shellcheck --version or "online"): 0.7.1
  • [x] The rule's wiki page does not already cover this (e.g. https://shellcheck.net/wiki/SC2086)
  • [x] I tried on https://www.shellcheck.net/ and verified that this is still a problem on the latest commit
  • [x] I searched through https://github.com/koalaman/shellcheck/issues and didn't find anything related

Here's a snippet or screenshot that shows the problem:


#!/bin/bash

# shellcheck source="/home/user/an example/tmp.sh"
source "$HOME/an example/tmp.sh"

Note: Those didn't work, neither:

# shellcheck source=/home/user/"an example"/tmp.sh
# shellcheck source='/home/user/an example/tmp.sh'
# shellcheck source=/home/user/an\ example/tmp.sh
# shellcheck source=/home/user/an example/tmp.sh

Here's what shellcheck currently says:

^-- SC1073: Couldn't parse this shellcheck directive. Fix to allow more checks. ^-- SC1072: Expected '=' after directive key. Fix any mentioned problems and try again.

Here's what I wanted or expected to see:

Shellcheck shouldn't say anything.


Thanks for Shellcheck, Vidar et al!

Ganton avatar Apr 06 '22 09:04 Ganton