1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Bash script array error on Shibby FW108?

Discussion in 'Tomato Firmware' started by leandroong, Apr 4, 2013.

  1. leandroong

    leandroong Addicted to LI Member

    sample script: test.sh
    #! /bin/sh
    Unix[1]='Red hat'

    echo ${Unix[1]}

    root@BTRouter2:/tmp# sh test.sh
    test.sh: line 2: Unix[0]=Debian: not found
    test.sh: line 3: Unix[1]=Red hat: not found
    test.sh: line 4: Unix[2]=Ubuntu: not found
    test.sh: line 5: Unix[3]=Suse: not found
    test.sh: line 7: syntax error: bad substitution

    Any idea?
  2. phuque99

    phuque99 LI Guru Member

    Busybox's ash shell does not support bash styled array.
    koitsu likes this.

Share This Page