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

Re: pipe every command



On Mon, Nov 5, 2012 at 3:03 PM, Benjamin R. Haskell <zsh@xxxxxxxxxx> wrote:
> On Mon, 5 Nov 2012, shawn wilson wrote:
>
>> is there a way to put every command through a pipe or redirect?
>>
>> i'd prefer some way that i can put logic in so that i can exclude some
>> commands. but, basically i want everything to go through 'source-highlight'
>> so:
>> ps ax | grep ssh
>> will end up:
>> ps ax | grep ssh | source-highlight -f esc256 -s shell
>>
>> and:
>> sa
>> would end up:
>> sa | source-highlight -f esc256 -s shell
>
>
> There might be a way to do this in the way you're talking about, but I
> accomplish a similar goal (being able to easily pipe things through `less`)
> using global aliases:
>
> alias -g L='| less'
>
> You could use:
>
> # H = highlight
> alias -g H='| source-highlight -f esc256 -s shell'
>

not as nicely baked in as i was hoping, but i guess it'll work. thanks



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