A simple 'awk' program using user-defined functions:Quote:> Is it possible to have functions on awk. If it is could anyone give me an
> example on how to use it.
> Thanks
function myFunction(string)
{
print "Hi there";
print string;
print "Bye there";
END {Quote:}
I hope this helps.Quote:}
> >Is it possible to have functions on awk. If it is could anyone give me an
> >example on how to use it.
> Yes it is possible, unless you use an old awk like the one in Solaris.
> If you are in Solaris, use nawk, not awk. The man page should say
> something about functions.
HTH
--
Opinions expressed are my own and not necessarily those of my employer.
1. Awk hex2dec() function anyone?
Anyone have, or know where I can find, an
awk function that converts hex values
that I find in a text file to decimal numbers
so I can do math on the numbers?
--
chris h.
2. Networking issue: cant get it up. Seeking help from Gurus
3. AWK system and close functions
8. Anybody know how to get an answering machine running on Linux?
9. function, function...who's got the function?
10. Environment Variables not functioning for 'system' in awk
11. Using system() function in an awk program