Thursday, May 2, 2024
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 2716  / 1 Year ago, tue, may 23, 2023, 7:38:19

When editing shell file in gedit, is there a way I could send current line (or selected block?) to terminal?



When learning Python I use Spyder IDE. It has an option to execute code selection or block in the console. Which I found very useful in learning what my scripts are doing step by step (or not doing ;).



Any chance to have something like that with gedit? Or any other text editor?


More From » command-line

 Answers
5

unfortunately, gedit don't have this function... However, GNU Emacs has the function you want!



To install it you must type:



sudo apt-get install emacs



After installed, you can create a new buffer (i.e., a new file). Depending on the file extension, the Emacs will change the menus to give you appropriate options...



For a simple test, you can create a new shell script file (with the extension ".sh"). After saving the file, a new menu "Sh-Script" will appear. This menu has two options related to your demand: "Execute Script..." and "Execute region".



I don't know what kind of files you want to use this functionality, but you can try to use Emacs!



Best regards,



Rafael.


[#42804] Thursday, May 25, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
skaing

Total Points: 462
Total Questions: 124
Total Answers: 113

Location: Nauru
Member since Thu, Feb 2, 2023
1 Year ago
skaing questions
;