Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function to function call 1

Status
Not open for further replies.

gawker

Programmer
Feb 21, 2002
34
US
Hi,

I've a ksh script that contains two user functions that perform an awk process.

example:

function user1_function
{
awk ' { misc. code } '
}

function user2_function
{
awk ' { print $0; user1_function } '
}

user1_function is defined before user2 function. The call to user1_function does not give me an error, but it also doesn't seem to work. Suggestions?

Thanks!

gawker [trooper]

 
If you're calling "user2_function" from within a SHELL script...

You cannot call a SHELL function from within AWK.
"user1_function" with in awk get evaluated "undefined" AWK variable. AWK has no notion of shell functions. Seems like only system utilities/tools get propagated down to the awk level.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top