Colin Watson <[email protected]> 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, and then the dam breaks open many
years too soon..
--steffen
--- Begin Message ---
On Thu, Jan 02, 2014 at 03:03:48PM +0100, Steffen Nurpmeso wrote:
> Colin Watson <[email protected]> wrote:
> |+2014-01-02 Colin Watson <[email protected]>
> |+
> |+ * 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 something like the below instead.
This will amount to $$-$$ on shells that don't support $RANDOM, which
seems rather pointless. Perhaps just:
tmp=$d/eqn2graph$${$RANDOM:+-$RANDOM}
then?
> Btw.: interesting that the auto-generated files like `configure'
> simply use $RANDOM, whereas the config.guess and such (i *never*
> used any auto*) do. Imho it is a bug that the generated scripts
> use /bin/sh but are not compatible to a real /bin/sh.
Good point about configure.
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. TBH I think I was trying to placate tools that check for
bashisms.
--
Colin Watson [[email protected]]
--- End Message ---