Skip to content

Files

Latest commit

 

History

History
26 lines (16 loc) · 512 Bytes

SC3044.md

File metadata and controls

26 lines (16 loc) · 512 Bytes

Pattern: Use of undefined declare command

Issue: -

Description

The declare command is non-standard, and most of its functionality is not available across shells.

Either find a POSIX replacement, or switch to a shell that is guaranteed to support them.

Example of incorrect code:

#!/bin/sh
declare var="value"

Example of correct code:

var="value"

Further Reading