OT: Function not recognized while calling a function from awk

Dak Ghatikachalam dghatikachalam at gmail.com
Fri Jan 26 17:34:41 UTC 2007


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 at isengard</u01/app/oracle>function dogdied
> {
>         echo "Why the hell did you die in $1"
> }
oracle at isengard</u01/app/oracle>
oracle at isengard</u01/app/oracle>export dogdied
oracle at isengard</u01/app/oracle>
oracle at isengard</u01/app/oracle>/oradata/,/u02/oradata"
<
oracle at isengard</u01/app/oracle>
oracle at 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 at isengard</u01/app/oracle>


Any idea

Thanks
Dak


More information about the freebsd-questions mailing list