Results 1 to 4 of 4
#!/bin/bash
var=HELLO
function hello {
var=HY
echo $var
}
echo $var
hello
echo $var
OUTPUT:
local-global-VAR.sh: function: not found
HY
local-global-VAR.sh: syntax error at line 8: `}' unexpected
What is ...
- 02-24-2009 #1Just Joined!
- Join Date
- Jan 2007
- Posts
- 9
What is wrong here ?
#!/bin/bash
var=HELLO
function hello {
var=HY
echo $var
}
echo $var
hello
echo $var
OUTPUT:
local-global-VAR.sh: function: not found
HY
local-global-VAR.sh: syntax error at line 8: `}' unexpected
What is wrong here ?
- 02-24-2009 #2
At a guess, I'd say that the problem is you're posting your homework questions to this forum, which is against the rules.
Linux user #126863 - see http://linuxcounter.net/
- 02-24-2009 #3
Going through a guide will be a good solution to this small problem
HERELast edited by b2bwild; 02-24-2009 at 11:47 AM. Reason: typo
- 02-24-2009 #4
Thanks for that Link b2wild. Bookmarked it.
Linux Registered User # 475019
Lead,Follow, or get the heck out of the way
AntiX,Puppy,Ubuntu,Windows 7=(cuz of scooters)
Open CourseWare for Linux Geeks


Reply With Quote