commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r646842 - /commons/sandbox/exec/trunk/src/test/scripts/forever.sh
Date Thu, 10 Apr 2008 18:30:26 GMT
On 10/04/2008, Siegfried Goeschl <siegfried.goeschl@it20one.at> 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, sgoeschl@apache.org <sgoeschl@apache.org> 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:
> dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>  For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message