|
|
|
|
UGU: Unix Guru Universe - Unix Tip #4337- January 25, 2024
- Home : Help
: Today's Tip
Unix Tip #4337- January 25, 2024
DELETING BLANK LINES USING GREP
For thos who are not familiar with
awk, but still want a quick and easy
way of removing blank lines from a
flat ascii file, remember that the
use of 'cat' in conjuction with
'grep' is just as effective.
cat file1 | grep -v '^$' >file2
mv -f file2 file1
This tip generously supported by: dave_tomkins@tands.co.uk
NOTE: All tips provided are USE AT YOUR OWN RISK. Tips are submitted
by various unix admins around the globe. UGU suggest you read and
test each tip in a non-volitile environment before placing into
production.
LAST 5 TIPS
4336
- LIMIT THE SIZE OF DATA AREA
4335
- PROBE-SCSI-ALL and IOSTAT
4334
- VI COPY FILE TO FILE
4333
- SEARCH SEVERAL FILES
4332
- ARITHMETIC COMPARISON
I want to
SUBSCRIBE
and get a UGU Tip everyday.
I want to
UNSUBSCRIBE
and NOT get a UGU Tip everyday.
If you have a UNIX TIP let us know, we just may use it:
(All tips become the property of the Unix Guru Universe)
|
|
|
Copyright 1994-2024 Unix Guru Universe |
|
|
|
|