Hi,
I am trying to remove blank lines from a report by doing
grep -v "^$" file1 > file2
such that file2 doesn't contain blank lines.
Although it works on most of the blank lines, I still see few blank lines such as the one in the code. I am wondering why it doesn't remove *ALL* blank lines in the file.
Also, it will be helpful if any of you can guide me to how to remove all blank lines, and remove tab-spaces in each line if there's any. Getting it to work on the following peice of code using Korn-shell commands will be very helpful.
Thanks,
I am trying to remove blank lines from a report by doing
grep -v "^$" file1 > file2
such that file2 doesn't contain blank lines.
Although it works on most of the blank lines, I still see few blank lines such as the one in the code. I am wondering why it doesn't remove *ALL* blank lines in the file.
Also, it will be helpful if any of you can guide me to how to remove all blank lines, and remove tab-spaces in each line if there's any. Getting it to work on the following peice of code using Korn-shell commands will be very helpful.
Thanks,
Code:
Intro to Korn shell programming
*******************************
Why scripting?
Scripting, when done right, is a fast, easy way to "get the job done", without the usual "code,compile,test,debug" overhead of writing in C or some other compiled language. It is easier than C for multiple reasons:
1. Scripting commands tend to be more readable
2. Scriping languages tend to come with powerful tools
3. There is no "compile" phase
UNIX tends to take #2 to extremes, since it comes standard with "powerful tools" that can be strung together with pipes or other mechanisms, to get the result you want, with a short development time.