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?
Mmm... I get the prompt "Shell command on region:" in the mini-buffer. How is this supposed to work? I thought the region selected was going to be executed in a shell...
@nephewtom just type sh in prompt and then contents of buffer will be run via shell
7
When I am editing a shell script called foo.sh, I set the variable compile-command to "foo.sh". Then, C-c m (compile) or C-c r (recompile) executes the script. C-c m lets me add or modify arguments to the script before running it, C-c r will run it with the last arguments used.