Summary
To any administrator script reuse will always be upmost in the quest for efficiency. Using vim
at the command line can make for very quick and effective editing of a script and we can save typing in the use of abbreviations. These are best set within a user's personal .vimrc
file and are defined with the abbr
control. Beyond abbreviations, we can see the sense in using code snippets. These are pre-prepared blocks of code that can be read into the current script.
Finally, we had a look at the value in using color at the command line where a script will provide feedback. In the first look, these color codes are not the friendliest, but we can simplify the process by using variables. These variables can be set at runtime within the script and by using the source
command their values to read them into the current environment.
In the next chapter, we will look at other mechanisms that we can use to write test expressions simplifying the use of integers and variables.