Date: Fri, 26 Jan 2007 12:34:40 -0500 From: "Dak Ghatikachalam" <dghatikachalam@gmail.com> To: freebsd-questions@freebsd.org Subject: OT: Function not recognized while calling a function from awk Message-ID: <ba29b9b40701260934r2cdd1f27l2c066f1fb5291c8d@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
Dear Freebsd
I have something strange problem happening any input would be great
for some reason the Korn shell is not detecting the function that I am
calling from awk
Actual code excerpt is
function dogdied
{
echo "Why the hell did you die in $1"
}
export dogdied
RESTORE_LOCATION="/u03/oradata,/u01/app/oracle/oradata/,/u02/oradata"
echo $RESTORE_LOCATION |
awk -F, '{
for (i=1; i<=NF ;i++)
{ system ("dogdied $i")
print $i
}
}
'
------------
Output looks like below
-------------------------
oracle@isengard</u01/app/oracle>function dogdied
> {
> echo "Why the hell did you die in $1"
> }
oracle@isengard</u01/app/oracle>
oracle@isengard</u01/app/oracle>export dogdied
oracle@isengard</u01/app/oracle>
oracle@isengard</u01/app/oracle>/oradata/,/u02/oradata"
<
oracle@isengard</u01/app/oracle>
oracle@isengard</u01/app/oracle>echo $RESTORE_LOCATION |
> awk -F, '{
> for (i=1; i<=NF ;i++)
> { system ("dogdied $i")
> print $i
> }
> }
> '
sh: line 1: dogdied: command not found
/u03/oradata
sh: line 1: dogdied: command not found
/u01/app/oracle/oradata/
sh: line 1: dogdied: command not found
/u02/oradata
oracle@isengard</u01/app/oracle>
Any idea
Thanks
Dak
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ba29b9b40701260934r2cdd1f27l2c066f1fb5291c8d>
