Quote:
Originally Posted by gfhgfnhhn
what is wrong with the code below;
it starts ,then does nothing, (even it doesn't end)
#!/bin/awk
x=1
b="foo"
awk printf("%s got a %d on the last test\n","Jim",83)
myout=("%s-%d",b,x)
print myout
awk is awaiting input from a file or command line. If you want to run it without having to enter the input, try:
BEGIN{
a=1;
b="foo";
printf("%s got a %d on the last test\n","Jim",83)
myout="%s %d \n";
printf myout,b,a;
}
_______________________________________________________________________
else try:
{
a=1;
b="foo";
printf("%s got a %d on the last test\n","Jim",83)
myout="%s %d \n";
printf myout,b,a;
}'
"hello"
To end it type ^D. Pressing enter continues printing the output.