comp.sys.mac.programmer.misc
  Home FAQ Contact Sign in
comp.sys.mac.programmer.misc only
 
Advanced search
February 2008
motuwethfrsasuw
    123 5
45678910 6
11121314151617 7
18192021222324 8
2526272829   9
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.sys.mac.programmer.misc Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Odd ksh problem         


Author: Robert Peirce
Date: Feb 29, 2008 11:42

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 , 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.
Show full article (1.10Kb)
5 Comments
  daily.local         


Author: Robert Peirce
Date: Feb 29, 2008 05:03

The last step in daily.local is to mail the log file. For some reason
the log file that gets mailed only contains the first few lines of the
current day's log. I don't get the rest until the next day. I tried
sleeping for two minutes in the hope that wold flush the buffer, if that
was the problem, but it had no effect.

How can I get the full current log file at the point of mailing?

--
Robert B. Peirce, Venetia, PA 724-941-6883
bob AT peirce-family.com [Mac]
rbp AT cooksonpeirce.com [Office]
no comments
  Is quicktime API free?         


Author: Ronen Yacov
Date: Feb 25, 2008 08:58

Hi there,

Is the quicktime API free?
How can i get it?

Thanks,
Ron
2 Comments
  puzzling bug in iDisk file syncing         


Author: Tim Smith
Date: Feb 19, 2008 02:00

This isn't really a programmer issue, other than knowing about this bug
might let you design your apps to work around it, but I'm puzzled as to
HOW this bug works, and this seems the most likely group to figure it
out.

Consider this shell script:

#!/bin/bash
VOL=/Volumes/iDisk/Documents
NAME="foo"
mkdir $VOL/tmp
date > $VOL/tmp/data.txt
mv $VOL/$NAME $VOL/tmp.old
mv $VOL/tmp $VOL/$NAME
#touch $VOL/$NAME/data.txt
rm -rf $VOL/tmp.old
cat $VOL/$NAME/data.txt

Run it with your local copy of your iDisk mounted on /Volumes/iDisk, and
it makes a directory named foo, containing a file, data.txt, that just
contains a timestamp.
Show full article (2.41Kb)
1 Comment
  Something is stepping on something         


Author: Robert Peirce
Date: Feb 12, 2008 14:55

I have the following definitions in a header file:

/*
Declarations for database variables
*/

char t[TL]; /* ticker */
char n[SN]; /* name */
int g1,g2,g3; /* group codes */

TL is defined as 9 and SN as 31 in another header file.

They are used in the following code segment:

fgets(s1, BUF, sd);

strcpy(t, s1);
t[TL-1] = '\0';
printf ("Ticker = %%s.\n", t); // This is correct
printf ("Something happens between here . . .\n");

strcpy(n,s1+TL); // This is trashing t
printf ("And here . . .\n");
printf ("Ticker = %%s.\n", t); // This is trash
n[SN-1] = '\0';
Show full article (1.06Kb)
11 Comments
  Is there anything like sdb in OS X?         


Author: Robert Peirce
Date: Feb 11, 2008 18:15

I need to debug a C program and am at a loss how to do it short of
sticking debug print statements in it. I used to use sdb to get a quick
stack trace or to single step through a program. Is there anything like
that in OS X?

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


Author: Robert Peirce
Date: Feb 8, 2008 07:15

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.
Show full article (0.81Kb)
3 Comments
  using cat to get a list to for in sh or in ksh         


Author: Robert Peirce
Date: Feb 6, 2008 12:16

In sh and ksh, I have used

for i in `cat file`
do
do-something-with-$i
done

on other systems with no problem. In OS X, this sometimes hangs, but
sometimes it doesn't, which is very confusing. Pr also hangs, but for
some strange reason, head works in the same script!

Does anybody have any idea what I am doing wrong? This should always
work fine, but sometimes it doesn't.

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