Results 1 to 10 of 11
in my FC7, lets say i write the code in BASH or AWK in a file called hello.awk or just hello:
print " hello world ";
or
echo "hello world"
...
- 08-22-2007 #1Just Joined!
- Join Date
- Jul 2007
- Posts
- 34
can't define string in BASH or AWK
in my FC7, lets say i write the code in BASH or AWK in a file called hello.awk or just hello:
print " hello world ";
or
echo "hello world"
when i ./hello.awk or ./hello the terminal complains of undefined string: hello(?)world? is it because of my " " double quotations? because in my FC7 it seems smaller. if i copy paste a same statement with the normal double quotations, it works!. is there a way to change the double quotations to the normal one like this " "?
i hope u guys can help me
- 08-22-2007 #2
Hi
Try these
hello.awk
#!/usr/bin/awk -f
BEGIN {print "Hello, World!"}
Hello.sh
#!/bin/sh
echo "Hello World!"
- 08-23-2007 #3Just Joined!
- Join Date
- Jul 2007
- Posts
- 34
ok for example, i copy paste this from my FC7:
#!/bin/awk
BEGIN {print ¨Hello¨}
{total = $1 + $2 + $3}
{print $1 $2 $3}
END {}
and when i run it:
awk-f total.awk
awk: total.awk:3: BEGIN {print ¨Hello¨}
awk: total.awk:3: ^ invalid char '?' in expression
notice the double quote is a lot smaller. " and ¨. if i remove the #!/bin/awk still error
- 08-23-2007 #4
Change the #!/bin/awk to #!/usr/bin/awk
Heres a good website for awk programming AWK Programming
- 08-23-2007 #5Linux User
- Join Date
- Aug 2006
- Posts
- 458
- 08-23-2007 #6Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
Hi,
First thing to do if you want to learn something is to read as much as possible about it. There are a bump of information of scripting on the net. In every tutorial or book this is given as the first example. Just Google for it.
And.... I should begin with Bash scripting.
Regards
- 08-24-2007 #7Just Joined!
- Join Date
- Jul 2007
- Posts
- 34
- 08-24-2007 #8Linux User
- Join Date
- Aug 2006
- Posts
- 458
- 08-25-2007 #9Just Joined!
- Join Date
- Jul 2007
- Posts
- 34
- 08-25-2007 #10Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
It seems that your keyboard setting is not correct.
Try to change the default keyboard in Gnome to "US keyboard":
RegardsCode:System> Control Center> Hardware> Keyboard> Layouts


Reply With Quote
