6101 comments
2357 subscribers
6266 on Twitter
Subscribe! Feed reader E-mail

Eshell redirection

Mike Mattie has this awesome Emacs tip for
Eshell: redirecting to buffers and Lisp symbols!

To overwrite buffer “foo”:

ls > #<buffer foo>

To append to buffer “foo”:

ls >> #<buffer foo>

To insert at point in buffer “foo”:

ls >>> #<buffer foo>

To redirect to a Lisp symbol:

ls >#'some-variable

I had no idea Emacs could do that. Cool!

On Technorati: ,

E-Mail from Mike Mattie

Random Emacs symbol: ps-extend-face-list – Function: Extend face in ALIST-SYM.

Thanks to David Ongaro for catching that!

Short URL: http://sachachua.com/blog/p/4415
  • David Ongaro

    Nice. But probably the main points got lost in the various (?) migrations of your block. It should probably read like this:

    To overwrite buffer “foo”:
    ls > #

    To append to buffer “foo”:
    ls >> #

    To insert at point in buffer “foo”:
    ls >>> #

    • http://sachachua.com Sacha Chua

      Thanks for catching that! =)

  • David Ongaro

    I see, I have to escape the > and < myself X-)

    To overwrite buffer “foo”:
    ls > #<buffer foo>

    To append to buffer “foo”:
    ls >> #<buffer foo>

    To insert at point in buffer “foo”:
    ls >>> #<buffer foo>

  • http://gravatar.com/palacechan palacechan

    Why does something like this generate a redirection error though?

    for i in 13 288 3 {echo “$i ” | wc -c } > #

    Invalid redirection target: (#)
    Invalid redirection target: (#)
    Invalid redirection target: (#)

    • http://sachachua.com Sacha Chua

      Did you specify the buffer, like this? #<buffer whatever>

On This Day...

  • 2012: Weekly review: Week ending October 19, 2012 — The Small Business Forum was fun to sketchnote. Did lots of good stuff at my consulting gig. Biked through the [...]
  • 2011: Figuring out how to plan for a month — I’ve been doing weekly reviews since October 2006 (210 weekly reviews over ~260 weeks, or about 80% coverage), so I’ve [...]
  • 2010: Saving development time through virtual appliances — Photo (c) 2008 JakesDad – Creative Commons Attribution Licence 2.0 I’m beginning to be a big [...]
  • 2009: Almost a permanent resident! Decisions, decisions… — It’s a good thing I checked the status of my permanent residency application online, as the request for my passport [...]
  • 2007: Weekly review — This week, I focused on getting on board at IBM. I’m happy to say that the process was very smooth, and [...]
  • 2004: Trackback implementation for Emacs — From http://elisp.info/archive/80614224, posted by Mark A. Hershberger: This will be put into nnrss.el or weblogger.el, but, for now, here is an implementation [...]
  • 2004: ARGH! Drying clothes! — I refuse to be held hostage by laundry tags. I’ll hang the suits up to dry, but darn if I’ll let [...]
  • 2004: Tentative Osaka plans — - Work tomorrow - Leave MSI at 5:40 and arrive at TKC by 7:30. - Shower and change into casual clothes. Pick [...]
  • 2004: First day — Think technical challenge. Think fun. Don’t think about classrooms and a dorm five minutes away from school. Delphi is fun, although I [...]
  • 2004: Training so far — Software installation in a foreign language is difficult. The first time around, I selected “repair” instead of “reinstall”. I realized my mistake [...]

Get the highlights as a PDF!

Stories from my Twenties: Highlights from a Decade of Blogging

Free sample!