Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Segfault in =( ) substitution



On Wed, 17 Oct 2012 20:20:30 +0100
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> On Sun, 14 Oct 2012 23:30:28 -0400
> Vin Shelton <acs@xxxxxxxxxxxxxxxxxxxx> wrote:
> > Starting very recently, I'm getting a core dump from this code:
> >...
> > [[ -n $pat1 ]] && diff1=( =(perl -p -e $pat1 < $file1) )
> 
> This should fix the crash, however the resulting code isn't very useful.

I suppose it's worth pointing out you can now do things like this...

() {
   print File $1:
   cat $1
} =(print This be the verse)

producing:

File /tmp/zsh0wPl3Y:
This be the verse

That's a better bet than any hack within the shell that I can think of
because the scoping is obvious.

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



Messages sorted by: Reverse Date, Date, Thread, Author