Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > Mac Programmer > ksh scripting p...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 992 of 1033
Post > Topic >>

ksh scripting problem

by Robert Peirce <bob@[EMAIL PROTECTED] > Feb 8, 2008 at 03:15 PM

Does anybody have any idea why this works:

IFS='   '
exec 0< "db/s.d"
while read line
do
        set $line
        if      (($3>0)) && ((${15}<16))
        then

And this doesn't?

exec 0< "s.p"
while read line
do
        set $line
        ((++wkcnt))
        if      (($1>0))   [>0: arithmetic syntax error]
        then

The line is getting read correctly as shown if I do a print $1 after the 
set.

Actually, since the line in the second case only holds one field,
it should be possible to get away without doing a set, but I was trying 
to match the other code.

The first few lines of s.p look like

   16.1299990
   16.7199990
   16.9800000
   16.0000000
   16.9900000

-- 
Robert B. Peirce, Venetia, PA  724-941-6883
bob AT peirce-family.com [Mac]
rbp AT cooksonpeirce.com [Office]
 




 4 Posts in Topic:
ksh scripting problem
Robert Peirce <bob@[EM  2008-02-08 15:15:13 
Re: ksh scripting problem
Robert Peirce <bob@[EM  2008-02-08 16:05:51 
Re: ksh scripting problem
Robert Peirce <bob@[EM  2008-02-08 16:53:31 
Re: ksh scripting problem
Robert Peirce <bob@[EM  2008-02-08 18:41:02 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 19 23:32:24 CDT 2008.