Unix Shell - too long eval problem

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > January 2006 > too long eval problem





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author too long eval problem
roopa

2006-01-31, 8:00 am

Hi all,
I am using eval to call a function. In this function i am calling awk.
In awk i am returning more number of variables. So i am getting name
too long error. I am using korn shell script in Sunsolaris. The code ia
as below

func ()
{
awk -f temp2 ${src_dir}/${inputfile} 2>> ${dest_dir}/${errorfile}
}
eval "`func`"

temp2 file consist of pattern and action for awk in which i have
written the code like the below

print "marketcount=" $1

Like this i am trying to return large number of variables.
help me

Thank you

danr

2006-01-31, 7:20 pm


roopa wrote:
> Hi all,
> I am using eval to call a function. In this function i am calling awk.

....
> eval "`func`"
>

....
> Thank you


Just a quick, untested, first thought. On occasion, I've run into
problems when using backticks. If this is ksh, try the $(...)
construct instead. Please let me know if it makes a difference.

Regards,
Dan

danr

2006-01-31, 7:20 pm

Another, quick, untested shotgun-approach suggestion (sorry about that,
but shell scripting lends itself to that approach). Have each awk
"print" also print a trailing semicolon. Perhaps that will essentially
break up your single too-long line that the shell is finally seeing.

Dan

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com