Computing.Net > Forums > Unix > error while calling function

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

error while calling function

Reply to Message Icon

Name: thaj
Date: June 9, 2004 at 23:22:37 Pacific
OS: Windows NT
CPU/Ram: 512Mhz
Comment:

Hi,
I am looking for a pattern in a file. Once i get the pattern, i assign it to a variable amd checking it. While running the script, it says, "err1 not found". I am pasting the code out here, can anyone please help me out?.

check()
{

err1 = `grep 0200001 $SRV_FILE | cut -d" " -f1 | cut -c1-7`

if test [ $err1 = $ERROR1 ]
then
handle_errors 1
exit 0
else
handle_errors 0
exit 1
fi
}




Sponsored Link
Ads by Google

Response Number 1
Name: Dlonra
Date: June 10, 2004 at 06:26:21 Pacific
Reply:

try
if test [ "$err1" = "$ERROR1" ]


0

Response Number 2
Name: thepubba
Date: June 10, 2004 at 07:34:44 Pacific
Reply:

Try getting rid of the space between err1 and =

err1 = `grep 0200001 $SRV_FILE | cut -d" " -f1 | cut -c1-7`

should read:

err1=`grep 0200001 $SRV_FILE | cut -d" " -f1 | cut -c1-7`



0

Response Number 3
Name: thaj
Date: June 16, 2004 at 22:38:06 Pacific
Reply:

Thanks a lot Jerry Lemeieux. Your reply works great!.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: error while calling function

Calling Functions using extended stored www.computing.net/answers/unix/calling-functions-using-extended-stored-/1936.html

error while compiling jdk14 www.computing.net/answers/unix/error-while-compiling-jdk14-/5332.html

Korn shell function export www.computing.net/answers/unix/korn-shell-function-export/5687.html