Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs: Execute code in shell-script mode

Tags:

emacs

In sh-mode in Emacs, I was looking for a way to execute a shell script in the current buffer directly like the C-c C-c in Python-mode. Using M-! is really tiring. Any amount of googling doesn't help. Is this possible?

like image 249
Sahas Avatar asked Dec 09 '09 06:12

Sahas


Video Answer


1 Answers

M-| is shell-command-on-region

so if you want to execute the whole buffer, C-x h M-| or you can rebind to something more convenient.

like image 125
cobbal Avatar answered Sep 20 '22 11:09

cobbal