![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| shell script command | lg123 | UNIX and Linux Applications | 3 | 04-11-2008 12:35 AM |
| Use ftp command in shell script | infyanurag | Shell Programming and Scripting | 3 | 02-05-2008 05:06 AM |
| cd command is not working in my shell script | amitrajvarma | Shell Programming and Scripting | 3 | 10-03-2007 02:04 AM |
| how to use cd command in shell script | LAKSHMI NARAYAN | Shell Programming and Scripting | 3 | 09-09-2007 03:04 AM |
| vi command in shell script | bryan | UNIX for Dummies Questions & Answers | 2 | 05-23-2006 04:51 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Shell script command
Can any one tell me how can i delete all the content
of a file at one go using Vi editor ??? It's urgent |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Few ways actually...
I would go with this one for vi Inside vi, issue these Code:
:1 dG :w |
|
#3
|
|||
|
|||
|
Thanx
It has worked Thanx a lot
|
|
#4
|
||||
|
||||
|
or simply:
Code:
:%d :w |
|
#5
|
|||
|
|||
|
or simply
d <Shift g> |
|
#6
|
||||
|
||||
|
Quote:
|
|
#7
|
||||
|
||||
|
you could also empty the file out before starting vi ...
Code:
echo > /dir/file; vi /dir/file |
||||
| Google The UNIX and Linux Forums |