Computing.Net > Forums > Unix > Error Message

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 Message

Reply to Message Icon

Name: anilcgowda
Date: August 10, 2005 at 16:39:16 Pacific
OS: UNIX
CPU/Ram: 1GB
Comment:

Hi,

I'm getting an error message: "Specify a parameter with this command" when I'm executing the following code -
------
Header_Info=`head -1 ${LoadDir}/${FileName} | awk '{print $1}'`

RowCount=`wc -l ${LoadDir}/${FileName} | awk '{print $1}'`
RowCount=`expr $RowCount - 2`

Number_of_Records=`echo $Header_Info | cut -c 111-117`

echo "$FileName,$RowCount,," >> $FinalDir/$Header_File

if [ $RowCount -eq $Number_of_Records ]
----------
The error message is pointed at the line with 'if' condition. As far as I can see, I've specified the proper parameters.

Can anyone please suggest why this error is occuring and how to correct it.

Thanks,
Anil




Sponsored Link
Ads by Google

Response Number 1
Name: Jim Boothe
Date: August 11, 2005 at 06:53:33 Pacific
Reply:

I believe that the Number_of_Records variable that you are cutting out of Header_Info is null. Do an echo right before that if-statement to prove it:

echo "Number_of_Records=$Number_of_Records"

if [ $RowCount -eq $Number_of_Records ] ...

If that is a valid situation, one way to avoid the syntax error is to use double_quotes:

if [ $RowCount -eq "$Number_of_Records" ] ...


0
Reply to Message Icon

Related Posts

See More


set background/foreground... cron job



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 Message

Unix Error Message Translation www.computing.net/answers/unix/unix-error-message-translation/3056.html

another error message www.computing.net/answers/unix/another-error-message/4940.html

error message www.computing.net/answers/unix/error-message/4939.html