awk: cant open
Hi Guys,
I was just trying to run a bunch of test scripts which ran perfectly before. But i just changed it to run on a different solaris version and my awk statement in the script shows an error. Code:
awk BEGIN{s=ARGV[1]; r=ARGV[2]; \ Code:
awk: can't open passed The script worked perfectly before and now it gives an error. I tried copying existing awk and using that but still i get the same error. Can anyone give any suggestions on how to go about this problem? |
I am surprised it ever worked. You need double quotes around your second argument i.e. "(1/1 - 100%)"
|
well, both the arguments passed and (1/1 - 100%) are variables. The second variable was double quoted.
|
Maybe did you forgot the single quotes around the awk program? The error means it's trying to open a file called "passed", as if you did not put the BEGIN statement.
|
Well my command line is something like this :
Code:
nawk 'BEGIN{t=ARGV[1]; s=ARGV[2]; r=ARGV[3]; \ |
Hmmm... it works for me on a Solaris Sparc 5.8 using nawk. The syntax looks correct. An aside note: you can use the printf command and shell's parameter substitution (for the substr part) to do the same thing without using awk.
|
All times are GMT -5. The time now is 09:20 AM. |