[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash script problems
From: |
William Park |
Subject: |
Re: bash script problems |
Date: |
Wed, 11 May 2005 13:05:37 -0400 |
User-agent: |
Mutt/1.4.2i |
On Thu, May 12, 2005 at 02:32:42AM +1000, Tony Jo wrote:
> 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
Note the difference between `...` and '...'
--
William Park <opengeometry@yahoo.ca>, Toronto, Canada
ThinFlash: Linux thin-client on USB key (flash) drive
http://home.eol.ca/~parkw/thinflash.html
Message not available