bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible bug with grep/sed/tail?


From: Paolo Bonzini
Subject: Re: Possible bug with grep/sed/tail?
Date: Fri, 21 Nov 2008 13:52:22 +0100
User-agent: Thunderbird 2.0.0.18 (Macintosh/20081105)

> But if the shared library is installed, you can
> instead use your own line-buffer function:
> 
> line-buffer()
> {
>   LD_PRELOAD=/t/linebuf.so "$@"
> }
> 
> but that doesn't expand the command name when it's an alias or function.

It actually works for functions.  To support aliases, you can do

  preload() {
    local so cmd
    so=$1
    cmd=$2
    shift 2
    case x`type -t "$cmd"` in
      xalias) eval LD_PRELOAD=\$so $cmd \"address@hidden" ;;
      *) LD_PRELOAD=$so "$cmd" "$@" ;;
    esac
  }

  alias line-buffer='preload /t/linebuf.so'

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]