ToolSura
    HomeToolsBlog
    Home/Authors/Ravi Iyer
    Ravi Iyer

    Ravi Iyer

    A shell script is a program in a language with several syntaxes and no diagnostics, so the quoting is not optional. A variable holding a filename with a space expands into two words unless it is quoted, and the usual fix is quoting everything, every time. Command substitution has the same problem, and so does a variable holding text you did not write. The word splitting rules differ between shells and between settings, which is why a script behaves differently under a different shell or with a different profile loaded. POSIX sh is the portable subset and bash adds arrays, brace expansion, pattern matching operators and a test construct that handles patterns and arithmetic. That test construct is worth its own paragraph. The older form takes a pattern and has its own escaping rules, and a pattern containing a bracket silently fails to match. The newer form behaves as expected, and mixing the two is the usual cause of a test that works in an interactive shell and fails in a script. The scheduling difference is the one that catches people. A cron job gets a near-empty environment, so a command that relies on an interactive setting fails with no obvious reason, and it fails silently because the output goes to a mailbox nobody reads. I finish on set and the options that change a script's behaviour for its children, since those propagate in ways that surprise. Every page here includes the form that fails, because the failure is what teaches the rule and the rule alone does not.

    About ToolSura

    ToolSura offers 80+ free, privacy-first online tools that run 100% in your browser — no uploads, no logins. Learn more about our mission →

    ToolSuraPrivacy-First Tools

    Free utilities that run in your browser. No trackers, no accounts, no uploads.

    All Systems Operational

    Product

    • Free Online Tools
    • Contact
    • FAQs
    • About

    Legal

    • Privacy Policy
    • Cookie Policy
    • Terms & Conditions

    Resources

    • Blog
    • Brand
    • Help

    Social Links

    • Bluesky
    • Mastodon
    • X
    • Product Hunt
    • GitHub
    • LinkedIn
    • DEV.to
    • YouTube

    © 2026 ToolSura. Free tools that run in your browser.

    Remote-First / Based in India

    Technical Manifesto

    Private • Client-Side • No Uploads

    ToolSura on Nick Launches
    Browser-Native
    Privacy-First