=`expr \( $year - 1900 \) \* 365`
echo $dayscount
exit
BTW, obviously I need a good book on SH programming. Any suggestions?
For ksh, the Korn Shell Book by David Korn and (iirc Morris Bolsky)
comes to mind.
-Otto
Cc: misc@openbsd.org
Subject: Re: SH programming
On Sun, 26 Jun 2005, Peter Bako wrote:
Ok, so this is not really an OpenBSD question but I am doing this on an
OpenBSD system and I am about to lose my mind...
I have done some basic shell scripting before but I've not had to deal
with
actual
AM
To: Peter Bako
Cc: misc@openbsd.org
Subject: Re: SH programming
On Sun, 26 Jun 2005, Peter Bako wrote:
Ok, so this is not really an OpenBSD question but I am doing this on an
OpenBSD system and I am about to lose my mind...
I have done some basic shell scripting before but I've
Try escaping the *
\*
Peter Bako wrote:
Hum, I get a syntax error: '*' unexpected
-Original Message-
From: Michael Erdely [mailto:[EMAIL PROTECTED]
Sent: Sunday, June 26, 2005 6:20 PM
To: Peter Bako
Cc: misc@openbsd.org
Subject: Re: SH programming
On 6/26/05, Peter Bako
month=$1
day=$2
year=$3
dayscount=$(expr ($year - 1900) * 365)
echo $dayscount
exit
This will generate a syntax error: `$year' unexpected error. I have tried
all sorts of variations and I am not getting it!!! HELP!!!
BTW, obviously I need a good book on SH programming. Any suggestions?
Thanks
On Sun, 26 Jun 2005, Peter Bako wrote:
#!/bin/sh
month=$1
day=$2
year=$3
dayscount=$(expr ($year - 1900) * 365)
echo $dayscount
exit
This will generate a syntax error: `$year' unexpected error. I have tried
all sorts of variations and I am not getting it!!! HELP!!!
man sh says
Hum, I get a syntax error: '*' unexpected
-Original Message-
From: Michael Erdely [mailto:[EMAIL PROTECTED]
Sent: Sunday, June 26, 2005 6:20 PM
To: Peter Bako
Cc: misc@openbsd.org
Subject: Re: SH programming
On 6/26/05, Peter Bako [EMAIL PROTECTED] wrote:
dayscount=$(expr ($year
On Sun, Jun 26, 2005 at 09:32:36PM -0400, Ted Unangst wrote:
On Sun, 26 Jun 2005, Peter Bako wrote:
#!/bin/sh
month=$1
day=$2
year=$3
dayscount=$(expr ($year - 1900) * 365)
echo $dayscount
exit
This will generate a syntax error: `$year' unexpected error. I have tried
: Sunday, June 26, 2005 6:20 PM
To: Peter Bako
Cc: misc@openbsd.org
Subject: Re: SH programming
On 6/26/05, Peter Bako [EMAIL PROTECTED] wrote:
dayscount=$(expr ($year - 1900) * 365)
Try:
dayscount=$((($year - 1900) * 365))
--
http://erdelynet.com/
Support OpenBSD! http://www.openbsd.org
9 matches
Mail list logo