Basic Shell Scripts

Many good references have been made for a very basic text editing program called vi. It was supposed to be accepted as visual text editor. 

As you see even with VIM or better said "Vi Improved" it is still not much of a visual editor in today world. Though it remains true that it would be better to use this "Visual" text editor over commands such as:

$ echo 'Some Text' >> /folder/file.txt

Which only places "Some Text" at the bottom of the file.txt located in the folder. 

So in a practical since if one is working remotely through a terminal you might struggle without the "Visual" editor. A simple example of how this can become frustrating would be to run these four commands and viewing the text file labeled log.txt after entering each command.

$ echo 'Log this tex' > log.txt

$ echo 't' > log.txt

$ echo 'Log this tex' > log.txt

$ echo 't' >> log.txt

On the other hand scripting is very useful in this same manor. One could do allot utilizing a script.

 

For Ubuntu users

To execute shell scripts from any directory without making changes to the system use the following 3 commands in a terminal to make bin directory for your user account.  Then place your scripts in your bin folder and you will be able to run the scripts anytime your logged in.

$ mkdir $HOME/bin

$ export PATH=$PATH:$HOME/bin

$ echo 'export PATH=$PATH:$HOME/bin' >> ~/.bash_profile