Launching the Editor
Explore how to start text editors from the Bash shell using different methods including GUI, command-line interface, and environment configurations. Understand how to handle path issues with spaces and special characters by using quoting or escaping. Learn to set PATH variables and create aliases to conveniently launch editors like Notepad++ directly from the terminal, streamlining your script editing process.
We'll cover the following...
There are several ways to run the source code editor. The first option is using the GUI of your OS. We can launch the editor via the “Start” menu or the desktop icon. It is the same way we run any other program.
Using CLI
The second option is using the command-line interface (CLI). This approach is more convenient in some cases. Here is an example of when we would need it. We call the find utility for searching several files. We can pass the find output to the source code editor input and open all found files. This is possible because most modern editors support CLI.
There are three ways to run an application in Bash:
- By the name of the executable.
- By the absolute path.
- By the relative path.
The first approach is the most convenient one. However, we need to add the installation path of the application to the PATH variable. Then, Bash can find the program’s executable when we call it.
Let’s suppose that we use Windows with the MSYS2 environment and we have the Notepad++ editor installed. Let’s consider how to run it by the executable name. The program has the following installation path by default: ...