How to pipe the selected content in Emacs’ buffer to external bash script and then print its output? The script can read data from pipe.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
shell-command-on-regionwhich is bound to M-|e.g.:
M-|
sort | uniq -cRETWith a prefix argument, the region is replaced by the output of the shell command (which effectively adds all shell commands to Emacs’ editing toolkit; very useful when you know how to do something outside of Emacs, but don’t know an equivalent native function).
C-uM-|
sort | uniq -cRET