![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| code that reads commands from the standard i/p and executes the commands | Phrozen Smoke | High Level Programming | 4 | 01-21-2007 11:06 PM |
| need help with some commands please | mujtba | UNIX for Dummies Questions & Answers | 2 | 01-14-2005 11:49 AM |
| sed commands | dbrundrett | Shell Programming and Scripting | 7 | 09-28-2004 02:11 PM |
| commands | kironpmullamkuz | Security | 2 | 06-27-2002 08:45 PM |
| BDS Commands | bbutler3295 | UNIX for Dummies Questions & Answers | 3 | 03-04-2002 05:28 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
vi commands
Hi,
a. How can we replace one more spaces with a single space in vi? b. Replace one more spaces following a full stop or a comma with two spaces.? c. Delete all blank line? d. Insert > and a space at the start of every line in the file? e. Reverse the order of lines in a file? f. In a file, how can two consecutive lines be combined into one? thanks, tictactoe |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
a. :%s/\ */ /g;
b. :%s/[,.]\ */ /g; c. % ! grep . d. %s/^/> /g e. Not quite sure what you mean on this one. f. Place cursor on top line, press J ( shift + j ) to join the lines. I haven't tried these, but they should work. You may have to modify them slightly. You should google for "regular expressions". |
|
#3
|
|||
|
|||
|
Quote:
Code:
:g/.*/m0 Quote:
Code:
:v/./d Code:
:g/^$/d |
|||
| Google The UNIX and Linux Forums |
| Tags |
| regex, regular expressions |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|