EnglishFrenchSpanish

OnWorks favicon

shellcheck - Online in the Cloud

Run shellcheck in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command shellcheck that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


shellcheck - Shell script analysis tool

SYNOPSIS


shellcheck [OPTIONS...] FILES...

DESCRIPTION


ShellCheck is a static analysis and linting tool for sh/bash scripts. It's mainly focused
on handling typical beginner and intermediate level syntax errors and pitfalls where the
shell just gives a cryptic error message or strange behavior, but it also reports on a few
more advanced issues where corner cases can cause delayed failures.

ShellCheck gives shell specific advice. Consider the line:

(( area = 3.14*r*r ))

· For scripts starting with #!/bin/sh (or when using -s sh), ShellCheck will warn that
(( .. )) is not POSIX compliant (similar to checkbashisms).

· For scripts starting with #!/bin/bash (or using -s bash), ShellCheck will warn that
decimals are not supported.

· For scripts starting with #!/bin/ksh (or using -s ksh), ShellCheck will not warn at all,
as ksh supports decimals in arithmetic contexts.

OPTIONS


-e CODE1[,CODE2...], --exclude=CODE1[,CODE2...]
Explicitly exclude the specified codes from the report. Subsequent -e options are
cumulative, but all the codes can be specified at once, comma-separated as a single
argument.

-f FORMAT, --format=FORMAT
Specify the output format of shellcheck, which prints its results in the standard
output. Subsequent -f options are ignored, see FORMATS below for more information.

-s shell, --shell=shell
Specify Bourne shell dialect. Valid values are sh, bash and ksh. The default is
to use the file's shebang, or bash if the target shell can't be determined.

-V version, --version
Print version and exit.

FORMATS


tty Plain text, human readable output. This is the default.

gcc GCC compatible output. Useful for editors that support compiling and showing
syntax errors.

For example, in Vim, :set makeprg=shellcheck\ -f\ gcc\ % will allow using :make to
check the script, and :cnext to jump to the next error.

<file>:<line>:<column>: <type>: <message>

checkstyle
Checkstyle compatible XML output. Supported directly or through plugins by many
IDEs and build monitoring systems.

<?xml version='1.0' encoding='UTF-8'?>
<checkstyle version='4.3'>
<file name='file'>
<error
line='line'
column='column'
severity='severity'
message='message'
source='ShellCheck.SC####' />
...
</file>
...
</checkstyle>

json Json is a popular serialization format that is more suitable for web applications.
ShellCheck's json is compact and contains only the bare minimum.

[
{
"file": "filename",
"line": lineNumber,
"column": columnNumber,
"level": "severitylevel",
"code": errorCode,
"message": "warning message"
},
...
]

DIRECTIVES


ShellCheck directives can be specified as comments in the shell script before a command or
block:

# shellcheck key=value key=value
command-or-structure

For example, to suppress SC2035 about using ./*.jpg:

# shellcheck disable=SC2035
echo "Files: " *.jpg

Here a shell brace group is used to suppress on multiple lines:

# shellcheck disable=SC2016
{
echo 'Modifying $PATH'
echo 'PATH=foo:$PATH' >> ~/.bashrc
}

Valid keys are:

disable
Disables a comma separated list of error codes for the following command. The
command can be a simple command like echo foo, or a compound command like a
function definition, subshell block or loop.

Use shellcheck online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    subconverter
    subconverter
    Utility to convert between various
    subscription format. Shadowrocket users
    should use ss, ssr or v2ray as target.
    You can add &remark= to
    Telegram-liked HT...
    Download subconverter
  • 2
    SWASH
    SWASH
    SWASH is a general-purpose numerical
    tool for simulating unsteady,
    non-hydrostatic, free-surface,
    rotational flow and transport phenomena
    in coastal waters as ...
    Download SWASH
  • 3
    VBA-M (Archived - Now on Github)
    VBA-M (Archived - Now on Github)
    Project has moved to
    https://github.com/visualboyadvance-m/visualboyadvance-m
    Features:Cheat creationsave statesmulti
    system, supports gba, gbc, gb, sgb,
    sgb2Tu...
    Download VBA-M (Archived - Now on Github)
  • 4
    Stacer
    Stacer
    Linux System Optimizer and Monitoring
    Github Repository:
    https://github.com/oguzhaninan/Stacer.
    Audience: End Users/Desktop. User
    interface: Qt. Programming La...
    Download Stacer
  • 5
    OrangeFox
    OrangeFox
    Fork of TeamWinRecoveryProject(TWRP)
    with many additional functions, redesign
    and more Features:Supports Treble and
    non-Treble ROMsUp-to-date Oreo kernel,
    built...
    Download OrangeFox
  • 6
    itop - ITSM  CMDB OpenSource
    itop - ITSM CMDB OpenSource
    IT Operations Portal: a complete open
    source, ITIL, web based service
    management tool including a fully
    customizable CMDB, a helpdesk system and
    a document man...
    Download itop - ITSM CMDB OpenSource
  • More »

Linux commands

Ad