> Folks, I think the aim of all shell scripts in groff is to be POSIX
> `sh' compatible. In case there are bashisms, they should be removed
> and/or circumvented.
I second that! "sh" is the lowest common denominator on nearly all UNIX
operating systems in existence. Therefore one should strive f
>> #!/bin/sh
>> # This script is written for the bash shell. See bash(1).
>>
>> Or is that just too obvious?
>
> Wouldn't #!/bin/bash be more obvious and less error-prone?
Folks, I think the aim of all shell scripts in groff is to be POSIX
`sh' compatible. In case there are bashisms, they sh
On Fri, Jan 03, 2014, Roger Leigh wrote:
> > #!/bin/sh
> > # This script is written for the bash shell. See bash(1).
> >
> > Or is that just too obvious?
>
> It's incorrect. If you're writing a script for the bash shell, then
> all you need to do is use
>
> #!/bin/bash
>
> and then you'll be
Hi Doug,
> I must be missing something in the discussion about random
> numbers. Why does groff need them? In the offered example
> tmp="$d/eqn2graph$groff_rand"
> the "random number" serves only to make a (supposedly) unique
> name. But of course, if the number is truly random, it is not
> gu
Doug McIlroy wrote:
|I must be missing something in the discussion about random
|numbers. Why does groff need them? In the offered example
|tmp="$d/eqn2graph$groff_rand"
|the "random number" serves only to make a (supposedly) unique
|name. But of course, if the number is truly random, it
I must be missing something in the discussion about random
numbers. Why does groff need them? In the offered example
tmp="$d/eqn2graph$groff_rand"
the "random number" serves only to make a (supposedly) unique
name. But of course, if the number is truly random, it is not
guaranteed to be unique.
On Thu, Jan 02, 2014 at 09:12:38PM -0500, Peter Schaffter wrote:
> On Thu, Jan 02, 2014, Mike Bianchi wrote:
> > How is someone attempting to understand a #!/bin/sh script to know what
> > the
> > writer intended if there is no documented way to interpret the syntax?
>
> #!/bin/sh
> # This scri
On Thu, Jan 02, 2014 at 09:12:38PM -0500, Peter Schaffter wrote:
> On Thu, Jan 02, 2014, Mike Bianchi wrote:
> > How is someone attempting to understand a #!/bin/sh script to know what
> > the
> > writer intended if there is no documented way to interpret the syntax?
>
> #!/bin/sh
> # This scri
Hi Mike,
> Please define what a non-standard extension shell is.
Something that isn't in POSIX's sh.
> My point is that #!/bin/sh is the name of a shell command that is
> not documented. In fact it does not exist anymore.
There are many shells that aim to provide all of POSIX's sh's behaviou
Hi,
Tethys wrote:
> Since it's not guaranteed to be present, why not just ignore $RANDOM
> and use our own randomly generated integer instead? Something like:
>
> groff_rand=$(dd if=/dev/urandom bs=8 count=1 2>/dev/null | sum | sed
> 's/^0*//;s/ .*//')
> tmp="$d/eqn2graph$groff_rand
On Thu, Jan 02, 2014, Mike Bianchi wrote:
> How is someone attempting to understand a #!/bin/sh script to know what the
> writer intended if there is no documented way to interpret the syntax?
#!/bin/sh
# This script is written for the bash shell. See bash(1).
Or is that just too obvious?
--
On Thu, Jan 02, 2014 at 04:07:20PM +, Roger Leigh wrote:
> On Thu, Jan 02, 2014 at 05:00:04PM +0100, Ingo Schwarze wrote:
> > Hi Mike,
> >
> > Mike Bianchi wrote:
> >
> > > There is no man page for sh(1) .
> > > There is no executable for /bin/sh . On Debian ...
> >
> > Sorry if that answ
Hi,
Tethys wrote on Fri, Jan 03, 2014 at 12:06:31AM +:
> Colin Watson writes:
>>Perhaps just:
>>
>> tmp=$d/eqn2graph$${$RANDOM:+-$RANDOM}
>>
>>then?
That, or just
tmp=$d/eqn2graph$$-`date +%Y%m%d%H%M%S`
A collision is not dangerous in terms of security,
and we are only talking about a f
Colin Watson writes:
>Perhaps just:
>
> tmp=$d/eqn2graph$${$RANDOM:+-$RANDOM}
>
>then?
Since it's not guaranteed to be present, why not just ignore $RANDOM
and use our own randomly generated integer instead? Something like:
groff_rand=$(dd if=/dev/urandom bs=8 count=1 2>/dev/null | sum
Hi,
Roger Leigh wrote on Thu, Jan 02, 2014 at 04:07:20PM +:
> It isn't broken. It's just a minimal POSIX shell. It will work
> fine with any script, providing you aren't using any non-standard
> bash, ksh or zsh extensions. There might possibly be some new
> POSIX shell standard features w
On Thu, Jan 02, 2014 at 05:00:04PM +0100, Ingo Schwarze wrote:
> Hi Mike,
>
> Mike Bianchi wrote:
>
> > There is no man page for sh(1) .
> > There is no executable for /bin/sh . On Debian ...
>
> Sorry if that answer seems blunt, but it is not groff's
> problem if the shell is broken in Debia
Hi Mike,
Mike Bianchi wrote:
> There is no man page for sh(1) .
> There is no executable for /bin/sh . On Debian ...
Sorry if that answer seems blunt, but it is not groff's
problem if the shell is broken in Debian.
> For those reasons, I think #!/bin/sh should be outlawed!
Hilarious. :-D
Ralph Corderoy wrote:
|Hi Steffen,
|
|> I'd really rather do something like the below instead.
|...
|> -tmp=$d/eqn2graph$$-$RANDOM
|> +tmp=$d/eqn2graph$$-${RANDOM:-${$}}
|
|That's assuming the environment doesn't contain a RANDOM from somewhere.
ph!
|:-)
|
|Cheers, Ralph.
Colin Watson wrote:
|I suppose it isn't a fatal incompatibility, since $RANDOM just expands
|to the empty string on other shells and mkdir will probably fail; maybe
|we could just leave it alone since the above is really no better than
|that.[.]
yes of course.
It was just me seeing /bin/bash,
On Thu, Jan 02, 2014 at 03:03:48PM +0100, Steffen Nurpmeso wrote:
> Colin Watson wrote:
> |+2014-01-02 Colin Watson
> |+
> |+ * contrib/eqn2graph/eqn2graph.sh: Use bash rather than sh; $RANDOM
> |+ is a bashism.
> |+ * contrib/grap2graph/grap2graph.sh: Likewise.
> |+ * con
Hi Steffen,
> I'd really rather do something like the below instead.
...
> -tmp=$d/eqn2graph$$-$RANDOM
> +tmp=$d/eqn2graph$$-${RANDOM:-${$}}
That's assuming the environment doesn't contain a RANDOM from somewhere.
:-)
Cheers, Ralph.
Happy new year.
Colin Watson wrote:
|+2014-01-02 Colin Watson
|+
|+ * contrib/eqn2graph/eqn2graph.sh: Use bash rather than sh; $RANDOM
|+ is a bashism.
|+ * contrib/grap2graph/grap2graph.sh: Likewise.
|+ * contrib/pic2graph/pic2graph.sh: Likewise.
I'd really rather do so
22 matches
Mail list logo