New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: bash: #1133

Open
pabs3 opened this Issue Mar 2, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@pabs3

pabs3 commented Mar 2, 2018

For new checks and feature suggestions

  • [?] shellcheck.net (i.e. the latest commit) currently gives no useful warnings about this
    • No idea as it requires JavaScript
    • No warnings from shellcheck 0.4.6-1 in Debian
  • I searched through https://github.com/koalaman/shellcheck/issues and didn't find anything related

Here's a snippet that shows the problem:

#!/bin/bash
alias foo='echo bar'
foo

Here is an illustration of the results:

$ dash foo.sh
bar
$ bash foo.sh
foo.sh: line 3: foo: command not found
$ bash --posix foo.sh
bar

Here's what shellcheck currently says:

Nothing.

Here's what I wanted or expected to see:

line 3: bash does not support using an alias when not in interactive mode and shopt expand_aliases is not set.

Reference

https://www.gnu.org/software/bash/manual/html_node/Aliases.html

@Dmole

This comment has been minimized.

Dmole commented May 15, 2018

shellcheck.net currently gives no useful warnings about this.

@koalaman

This comment has been minimized.

Owner

koalaman commented May 27, 2018

Is there a good way to warn that won't also trigger for shellcheck -s bash ~/.bashrc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment