GithubHelp home page GithubHelp logo

Comments (4)

koalaman avatar koalaman commented on July 22, 2024

Verified and fixed.

from shellcheck.

grimreaper avatar grimreaper commented on July 22, 2024

This should still warn as a non-portable extension. some ls(1) lack the -N option

from shellcheck.

arth1 avatar arth1 commented on July 22, 2024

Because ls is an external command (unless you use tcsh), it is non-portable by nature. Sure, it could be BusyBox ls or a legacy Unix system, but if warning against that, surely one would have to warn about hundreds of commands and non-portable options, including (but not limited to) "ps -m", and "find -print0" | "xargs -0" and even "echo -n". One could, I suppose, check for POSIXLY_CORRECT or "set -p" and limit the well-known commands when that's in effect.

I'm of the opinion that when external programs are called, the caller is responsible for the arguments being supported where the script is run. It seems ... easier.

from shellcheck.

grimreaper avatar grimreaper commented on July 22, 2024

External commands are not non-portable by nature. There is a POSIX standard and provided that this is adhered to one should expect it to work.

echo -n is in POSIX. other echo flags are not. I would expect a warning for, e.g., echo -e to use printf instead.

from shellcheck.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.