Or if you're afraid, gem install gosh; wget http://uuner.doslash.org/forfun/sedtris.sed && curl http://uuner.doslash.org/forfun/sedtris.sh | gosh
Re:Sedtris: Tetris in sed
by throwa_way on Sunday April 10, 2011 @04:53PM
(#2430386)
Uh oh, you threw the stone in the proverbial argument well again:
You should be piping that into bash instead of sh.
With sh, it infinitely prints out
[: 48: unexpected operator
read: 48: Illegal option -s
Re:Sedtris: Tetris in sed
by w1ntermute on Sunday April 10, 2011 @05:25PM
(#2430452)
Haha, I take it you're on Ubuntu? Ubuntu uses dash[0] as its default shell to speed things up. Funny thing is I've run into this same issue before in another context with sh vs bash on Ubuntu. In any case, updated.
0: https://secure.wikimedia.org/wikipedia/en/wiki/Debian_Almqui...
Ubuntu uses dash as its default shell to speed things up.
Actually it is (sadly) the major reason, but not the only one:
The Debian policy manual has long mandated that "shell scripts specifying '/bin/sh' as interpreter must only use POSIX features"; in fact, this requirement has been in place since well before the inception of the Ubuntu project. Furthermore, any shell scripts that expected to be portable to other Unix systems, such as the BSDs or Solaris, already honoured this requirement. Thus, we felt that the compatibility impact of this change would be minimal. [1]
Personally I think that assuming nothing but POSIX is a more compelling reason than efficiency.
wget http://uuner.doslash.org/forfun/sedtris.sed && curl http://uuner.doslash.org/forfun/sedtris.sh | bash