May 7, 2003 #1 DanNJ MIS Mar 19, 2003 29 US Why won't this work? How can I make it work? Start Script: a1()( var=2; export var ) echo $var
May 7, 2003 #2 sampsonr Programmer May 22, 2002 75 US First Problem: Functions are defined curly braces, not parentheses, as shown below a1() { var=2; export var } Second Problem: You never actually call the function so the variable never gets set. Upvote 0 Downvote
First Problem: Functions are defined curly braces, not parentheses, as shown below a1() { var=2; export var } Second Problem: You never actually call the function so the variable never gets set.
May 7, 2003 Thread starter #3 DanNJ MIS Mar 19, 2003 29 US I forgot to call it when I typed it here, it seems that () keep the variables within the function but {} let them out. interesting. Upvote 0 Downvote
I forgot to call it when I typed it here, it seems that () keep the variables within the function but {} let them out. interesting.