In this article, we are going to see some of the most important settings which is mandatory for a developer to have in his .vimrc or .exrc file.
set incsearch : When we want to search for something in vi, we put a slash(/) and start typing the word in the escape mode. On finishing typing, and when we press enter, we get to know whether the word is present in the file or not. The setting ‘incsearch’ is a special feature in which you will know whether what you are typing is there or not in the file as you type it. As you keep tying, the matching contents keep getting highlighted. It is like in google search, we get to see the search results as we keep tying.
In one of our earlier articles, we saw how to read a file in awk. At times, we might have some requirements wherein we need to pass some arguments to the awk program or to access a shell variable or an environment variable inside awk. Let us see in this article how to pass and access arguments in awk:
Let us take a sample file with contents, and a variable "x":
$ cat file1
$ echo $x
Now, say we want to add every value with the shell variable x.