bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bash script problems


From: Tony Jo
Subject: bash script problems
Date: Thu, 12 May 2005 02:32:42 +1000

Hello, I am having issues with a bash script and I was wondering if anyone
could be of assistance? Its just that our lecturer assumed it would be easy
to pick up and do an assignment on, even though we haven't learnt it and its
not a pre-requisite.

But anyway, I noticed when I use the cut command to obtain some numbers from
a file, I cannot use it in an arithmetic operation. I tried the following:
temp='expr $val1 + $val2'
But I get the following error message:
expr: non-numeric argument

I was wondering if BASH requires type conversion? I even printed out the
values for $val1 and $val2. They look like integers to me. If anyone could
help me, it would be greatly appreciated.

Thanks in advance

Tony






reply via email to

[Prev in Thread] Current Thread [Next in Thread]