Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Array as parameter



Hi,

how can I use an array as a parameter to a function like
this (example does not work...just as an explanation, what
I want to do)

    #! /bin/zsh
    funcion arrprint()
    {
        for i in $1
        do
            echo $i
            echo "---"
        done
    }

    a=( 1 2 3 4 5 6 )

    arrprint a 

when executed shoult print
1
---
2
---
3
---
4
---
5
---
6
---


Thank you very mich in advance for any help!
Best regards,
mcc




Messages sorted by: Reverse Date, Date, Thread, Author