LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Bash Script Passing variable to Function (http://www.linuxquestions.org/questions/programming-9/bash-script-passing-variable-to-function-285257/)

nutthick 02-02-2005 05:49 AM

Bash Script Passing variable to Function
 
In Bash Script, what is the syntax for passing a variable to a function. I'm assuming it's something like.

function MyFunction(MyVariable)
{
}

and then to call it you do something like

MyFunction(10)

but I can't get it to work.

Thanks

nixcraft 02-02-2005 06:08 AM

see http://www.cyberciti.biz/nixcraft/li...t/scripts/pass

nutthick 02-02-2005 06:15 AM

Thanks nixcraft worked a treat


All times are GMT -5. The time now is 09:30 AM.