Shellcheck: readarray/mapfile should create variables

Created on 16 Apr 2015  路  1Comment  路  Source: koalaman/shellcheck

Bash readarray/mapfile assign variables, but shellcheck doesn't understand.

#!/bin/bash
readarray blah <<< $'hi\nthere'
echo "${blah[@]}"
In foo.sh line 3:
echo "${blah[@]}"
      ^-- SC2154: blah is referenced but not assigned.

Most helpful comment

Fixed in 509cda4

>All comments

Fixed in 509cda4

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hellresistor picture hellresistor  路  3Comments

erwinkramer picture erwinkramer  路  5Comments

hugovk picture hugovk  路  4Comments

sobolevn picture sobolevn  路  4Comments

phagara picture phagara  路  4Comments