[Bash-completion-devel] unalias sed? (was: Re: [Bash-completion-commits] [SCM] bash-completion branch, master, updated. b14fdb74b3b7fd7a707bc2afea55c10ea521d4f0)

Ville Skyttä ville.skytta at iki.fi
Sun Jun 7 18:07:06 UTC 2009


On Friday 05 June 2009, David Paleino wrote:
> On Fri, 5 Jun 2009 18:41:07 +0300, Ville Skyttä wrote:
> > On Friday 05 June 2009, David Paleino wrote:
> > > @@ -3673,3 +3673,6 @@ unset UNAME USERLAND default dirnames filenames
> > > have nospace bashdefault plusdir
> > >
> > >  set $BASH_COMPLETION_ORIGINAL_V_VALUE
> > >  unset BASH_COMPLETION_ORIGINAL_V_VALUE
> > > +
> > > +# remove aliases we set earlier
> > > +unalias sed
> >
> > Like I explained in Alioth #311393, I believe the unalias here is wrong -
> > it results in our aliased sed being in effect only for the duration of
> > reading bash_completion and the split files, not at runtime when sed gets
> > actually invoked and we for now want it to cope with GNU sed extensions.
>
> Ok, good.
> What about:
>
> alias mysed=sed
> have gsed && alias mysed=gsed
>
> ?
>
> (we can obviously change "mysed" to something else, it's just to clarify
> the solution)

If we go down that route, does the alias buy us anything over a usual shell 
variable?  For example

   have gsed && _bashcomp_sed=gsed || _bashcomp_sed=sed



More information about the Bash-completion-devel mailing list