Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Apr 1998 13:03:56 +0000
From:      Niall Smart <rotel@indigo.ie>
To:        Dean Hollister <dean@odyssey.apana.org.au>, FreeBSD Questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: bash: multiplication
Message-ID:  <199804131203.NAA01088@indigo.ie>
In-Reply-To: Dean Hollister <dean@odyssey.apana.org.au> "bash: multiplication" (Apr 13,  5:52pm)

next in thread | previous in thread | raw e-mail | index | archive | help
On Apr 13,  5:52pm, Dean Hollister wrote:
} Subject: bash: multiplication
> According to the expr man page, the following should work:
> 
> #!/bin/bash
> 
> hrs=20
> mins=10
> 
> time=`expr ${hrs} * 60`
> time=`expr ${time} + ${mins}`
> 
> However, it falls over (syntax error) on the first expr line. Any ideas?

Remember, * expands to the list of files in the current directory.

time=`expr ${hrs} '*' 60`



-- 
Niall Smart.  Microsoft Suck.  See www.freebsd.org for details.
echo "#define if(x) if(!(x))" >> /usr/include/stdio.h

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804131203.NAA01088>