The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
shell script command lg123 UNIX and Linux Applications 3 04-11-2008 03:35 AM
Use ftp command in shell script infyanurag Shell Programming and Scripting 3 02-05-2008 08:06 AM
cd command is not working in my shell script amitrajvarma Shell Programming and Scripting 3 10-03-2007 05:04 AM
how to use cd command in shell script LAKSHMI NARAYAN Shell Programming and Scripting 3 09-09-2007 06:04 AM
Shell script command dipanrc Shell Programming and Scripting 7 11-29-2005 11:15 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-23-2006
bryan bryan is offline
Registered User
  
 

Join Date: Jan 2005
Posts: 22
vi command in shell script

I need to delete all the new lines in a file.
so, in vi, I would use
:1,$s/\n//g and then save the file.

How can I achieve this in command line? thanks
  #2 (permalink)  
Old 05-23-2006
Sheetal Sheetal is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 11
Will this help
cat filename|grep -v '^$'

You can forward this result to another file ....
cat filename|grep -v '^$' > filename2
  #3 (permalink)  
Old 05-23-2006
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,190
Code:
tr -d '\n' < file > newfile
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 09:46 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0