On 10/04/2008, Siegfried Goeschl <[EMAIL PROTECTED]> wrote: > Hi Sebb, > > > > But that does not work on e.g. FreeBSD. > > > > Indeed the code will now just create an ever-larger file, not print > > ... to the screen > > > > +) printing the funny dots was just something I ommited to delete - I want > to make a verification to ensure that the script was executed successfully > by ensure that the file exists and is not empty
In that case, use > rather than >> (and document what the purpose is) > +) would the statement would work on FreeBSD in general? AFAIK echo '.\c' "works" on any Un*x, as does echo -n . in the sense that something will be printed. However some OSes (e.g. HP-UX) use the first format to suppress the EOL, most use the second format. I don't know how to differentiate them (other than adding a test before the loop) Is it important that the output file is updated every second? > Cheers, > > Siegfried Goeschl > > sebb wrote: > > > > > On 10/04/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > > Author: sgoeschl > > > Date: Thu Apr 10 08:22:17 2008 > > > New Revision: 646842 > > > > > > URL: http://svn.apache.org/viewvc?rev=646842&view=rev > > > Log: > > > Changed the usage of the echo statement to work with HP-UX (thanks to > sebb) > > > > > > Modified: > > > > commons/sandbox/exec/trunk/src/test/scripts/forever.sh > > > > > > Modified: > commons/sandbox/exec/trunk/src/test/scripts/forever.sh > > > URL: > http://svn.apache.org/viewvc/commons/sandbox/exec/trunk/src/test/scripts/forever.sh?rev=646842&r1=646841&r2=646842&view=diff > > > > ============================================================================== > > > --- > commons/sandbox/exec/trunk/src/test/scripts/forever.sh > (original) > > > +++ > commons/sandbox/exec/trunk/src/test/scripts/forever.sh Thu > Apr 10 08:22:17 2008 > > > @@ -22,6 +22,5 @@ > > > while test "notempty" > > > do > > > sleep 1 > > > - echo -n . > > > - # echo -n . >> ./target/forever.txt > > > + echo '.\c' >> ./target/forever.txt > > > > > > > > > > But that does not work on e.g. FreeBSD. > > > > Indeed the code will now just create an ever-larger file, not print > > ... to the screen > > > > > > > > > done > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
