May 7, 2003 #1 DanNJ MIS Joined Mar 19, 2003 Messages 29 Location 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 Joined May 22, 2002 Messages 75 Location 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 Joined Mar 19, 2003 Messages 29 Location 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.