From: Stuart M. <Stu...@st...> - 2000-11-08 19:41:12
|
Peter It's working fine for me, using the RPMs from SourceForge and a test8 kernel. I suspect it is a problem with the C library you are using. Assuming you are using a reasonably modern C library implementation, when output is being sent to a terminal, it will normally be line buffered, so will be output when the puts() is called. However when you are redirecting output to a file, it will be fully buffered, so is normally output when the program exits (you won't be generating enough data to fill the buffer in these examples). I'm not sure what to suggest however. You could try explicitly calling fflush(stdout) to make sure this is what's happening. Also try using exit() to see if that works. I think we'd need to know which C library you are using to make any more progress. Stuart pe...@co... writes: > Hello folks, > > I got the problem about puts() function. > > ex: test.c > > #include <stdio.h> > main(){ > puts("Hello World\n"); > } > > in x86 platform: > > debian:/tmp# gcc -o test test.c > debian:/tmp# ./test > Hello World > debian:/tmp# ./test > output > debian:/tmp# cat output > Hello World > > > in SuperH platform: > > debian:/tmp# gcc -o test test.c > debian:/tmp# ./test > Hello World > debian:/tmp# ./test > output > debian:/tmp# cat output > debian:/tmp# (No output) > > I found all the program that use the puts() will cause the some problem in > shell script. The program 'basename' uses puts() to output the basename of > input string. Below is a piece of install-sh shell script. You will find > the result in '$dstfile' is emply below: > > dst=/usr/bin/cmp > dstfile=`basename $dst` > > If you have program 'basename', please test it. Thanks. > > > - PhantomCat > > -- > Peter Hung * Email : pe...@co... > Engineer @ Coventive Technologies * Phone : 886-919-616-535 > _______________________________________________ > linuxsh-dev mailing list > lin...@li... > http://lists.sourceforge.net/mailman/listinfo/linuxsh-dev -- Stuart Menefy st...@in... SGS Thomson Microelectronics Ltd, Bristol or st...@br... ------------------------------------------------------------------------- Now I can't not speak for Inmos, I don't speak for SGS Thomson either.... |