Re: SH programming

2005-06-27 Thread Otto Moerbeek
=`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

Re: SH programming

2005-06-27 Thread Tony
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

Re: SH programming

2005-06-27 Thread Otto Moerbeek
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

Re: SH programming

2005-06-27 Thread Dimitri
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

SH programming

2005-06-26 Thread 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

Re: SH programming

2005-06-26 Thread Ted Unangst
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

Re: SH programming

2005-06-26 Thread Peter Bako
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

Re: SH programming

2005-06-26 Thread Stephen Marley
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

Re: SH programming

2005-06-26 Thread Rod.. Whitworth
: 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