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 > Re: Odd ksh pro...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 6 Topic 1000 of 1040
Post > Topic >>

Re: Odd ksh problem

by Bob Harris <nospam.News.Bob@[EMAIL PROTECTED] > Mar 1, 2008 at 01:07 AM

In article <bob-A604BE.14425829022008@[EMAIL PROTECTED]
>,
 Robert Peirce <bob@[EMAIL PROTECTED]
> wrote:

> This worked on Uwin, but it is blowing up on my Mac.  I just have a 
> fragment here.
> 
> Data prints out a colon separated record of every week in our database 
> for a stock "$i."  I change the colon to <TAB>, extract the first, third

> and fourth fields and pass the last 200 lines on to a while loop.
> 
> I put tee foobar in to be sure the data was actually getting to the 
> loop.  It is.
> 
> The loop has been compressed to just print the lines coming in.  From 0 
> to 2 random lines get printed.  There is no pattern I have seen.  It is 
> possible you can't pipe data to a while loop on a Mac.  Maybe it isn't 
> supposed to work on any machine.  Maybe there is something about dual 
> core machines that causes the problem.
> 
> I could rewrite the script to use awk.  Originally it was an awk script 
> that I rewrote to experiment with ksh.  However, ksh ought to work if I 
> set it up right.
> 
> data $1 |
> tr : '\t' |
> field 1 3 4 |
> tail -200 |
> tee foobar |
> 
> while read -r line
> do print -r -- $line
> done

why not try

data $1 | awk -F: '{print $1, $3, $4}' | tail -200
 




 6 Posts in Topic:
Odd ksh problem
Robert Peirce <bob@[EM  2008-02-29 19:42:58 
Re: Odd ksh problem
Robert Peirce <bob@[EM  2008-02-29 20:52:09 
Re: Odd ksh problem
Bob Harris <nospam.New  2008-03-01 01:07:27 
Re: Odd ksh problem
Robert Peirce <bob@[EM  2008-03-01 17:04:56 
Re: Odd ksh problem
Bob Harris <nospam.New  2008-03-02 01:42:06 
Re: Odd ksh problem
Robert Peirce <bob@[EM  2008-03-02 16:17:33 

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 Nov 22 3:10:57 CST 2008.