Skip to content

Files

Latest commit

 

History

History
25 lines (16 loc) · 446 Bytes

SC3020.md

File metadata and controls

25 lines (16 loc) · 446 Bytes

Pattern: Use of undefined &>

Issue: -

Description

&> is a bash and ksh extension for redirecting both stdout and stderr. In dash and POSIX sh, use 2>&1 explicitly.

Example of incorrect code:

#!/bin/sh
ssh host cmd &> log

Example of correct code:

#!/bin/sh
ssh host cmd > log 2>&1

Further Reading