retitle 449592 $() breaks default library on SunOS /bin/sh thanks On Tue, 6 Nov 2007 17:35:49 -0500 Joey Hess <[EMAIL PROTECTED]> wrote:
> Ken Bloom wrote:
> > I'm trying out mr on a solaris machine, and running into bashisms in
> > mr's default configuration.
> >
> > [EMAIL PROTECTED] ~]$ mr register 546
> > sh: syntax error at line 24: `delta=$' unexpected
> > mr register: unknown repository type
> >
> > this occurs at line 1131 of mr (in the default configuration file
> > block)
> > delta=$(perl -wle 'print -f shift() ? int((-M _) * 24) : 9999'
> > "$flagfile")
> >
> > Here is a patch for various bashisms. It may not completely
> > eliminate all bashisms. In particular I only tried to fix the stuff
> > I needed to work with svn.
> >
> > --- bin/mr (revision 4157)
> > +++ bin/mr (working copy)
> > @@ -1128,7 +1128,7 @@
> > if [ -z "$flagfile" ]; then
> > error "cannot determine flag filename"
> > fi
> > - delta=$(perl -wle 'print -f shift() ? int((-M _) *
> > 24) : 9999' "$flagfile")
> > + delta=`perl -wle 'print -f shift() ? int((-M _) *
> > 24) : 9999' "$flagfile"`
>
> Eh, $() is in POSIX, it is not a bashism. What shell are you trying to
> use?
>
> FWIW, mr was developed on a system with /bin/sh -> dash, and works
> well here. I don't think the code contains any sort of bashism.
>
OK. I'm running on SunOS 5.10 (not Solaris like I originally
mentioned -- this isn't technically a debian bug, but I know of no
better place to report the bug). When I run their /bin/sh,
[EMAIL PROTECTED] ~]$ /bin/sh
$ echo $(which which)
syntax error: `(' unexpected
--Ken
--
Ken Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
signature.asc
Description: PGP signature

