0

I tried this command :

read -a arr <<< "a b c"

on centos, it runs well, but on kali (2023.2), it reports "read: bad option: -a"

I cannot find out why. Any help please?

Brian Holsen
  • 143
  • 4
  • 2
    Kali Linux nowdays uses `zsh` as the default user shell. So using `read -a` is not possible, instead use 'read -A': `read -A arr <<< "a b c"` – Edgar Magallon Jun 06 '23 at 08:35
  • 1
    `-A`, same as in ksh or yash, consistent with `set -A` (`set -a` from the Bourne shell being for something else). Why bash chose to use `-a` instead when it added array support decades after other shells and otherwise copied the awkward array design of the Korn shell is beyond me... – Stéphane Chazelas Jun 06 '23 at 08:40

0 Answers0