You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by sg...@apache.org on 2008/04/10 17:22:24 UTC
svn commit: r646842 - /commons/sandbox/exec/trunk/src/test/scripts/forever.sh
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
done
Re: svn commit: r646842 - /commons/sandbox/exec/trunk/src/test/scripts/forever.sh
Posted by sebb <se...@gmail.com>.
On 10/04/2008, Siegfried Goeschl <si...@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 <sg...@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
Re: svn commit: r646842 - /commons/sandbox/exec/trunk/src/test/scripts/forever.sh
Posted by Siegfried Goeschl <si...@it20one.at>.
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
+) would the statement would work on FreeBSD in general?
Cheers,
Siegfried Goeschl
sebb wrote:
> On 10/04/2008, sgoeschl@apache.org <sg...@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
Re: svn commit: r646842 - /commons/sandbox/exec/trunk/src/test/scripts/forever.sh
Posted by sebb <se...@gmail.com>.
On 10/04/2008, sgoeschl@apache.org <sg...@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