E.g.
- Code: Select all
#!/bin/sh
declare -a Unix=('Debian' 'Red hat' 'Red hat' 'Suse' 'Fedora');
echo ${Unix[@]}
Fail with:
- Code: Select all
./array.sh: 3: ./array.sh: Syntax error: "(" unexpected
Why does this happen?
#!/bin/sh
declare -a Unix=('Debian' 'Red hat' 'Red hat' 'Suse' 'Fedora');
echo ${Unix[@]}
./array.sh: 3: ./array.sh: Syntax error: "(" unexpected

using Cinnamon 1.8.8 & Nemo 1.8.3
eanfrid wrote:Your default shell called by the symlink /bin/sh is not bash but dash (debian shell), hence the error message

using Cinnamon 1.8.8 & Nemo 1.8.3
eanfrid wrote:You can safely use any alternative you like.
eanfrid wrote:Regarding dash, check wikipedia: https://en.wikipedia.org/wiki/Debian_Almquist_shell

using Cinnamon 1.8.8 & Nemo 1.8.3
Users browsing this forum: elgusanito, morayman, TallTire9 and 11 guests