Bash script array error on Shibby FW108?

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

  1. leandroong

    leandroong LI Guru Member

    sample script: test.sh
    #! /bin/sh
    Unix[0]='Debian'
    Unix[1]='Red hat'
    Unix[2]='Ubuntu'
    Unix[3]='Suse'

    echo ${Unix[1]}

    Error:
    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
    root@BTRouter2:/tmp#

    Any idea?
     
  2. phuque99

    phuque99 LI Guru Member

    Busybox's ash shell does not support bash styled array.
     
    koitsu likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice