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 > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Validation of character separated lines in a file kolesunil UNIX for Dummies Questions & Answers 3 05-27-2008 06:48 AM
Can I use sed to insert a string which has colon Jenny.palmy UNIX for Dummies Questions & Answers 2 04-28-2008 07:04 PM
Multiple field separators in awk? (First a space, then a colon) doubleminus UNIX for Dummies Questions & Answers 3 04-27-2008 03:28 PM
Separate lines in a single '|' separated line hidnana Shell Programming and Scripting 3 03-17-2008 10:16 AM
Splitting comma separated values into an array tmarikle Shell Programming and Scripting 3 06-24-2005 05:50 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-30-2005
tonlu tonlu is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 16
two lines into one colon separated line...

Does anyone know how to get these two output lines into one colon ':' separated line with some unix command? Maybe nawk. I've tried to read the nawk and awk man pages but I don't get it right. Are these commands the one to use?

Output from find command:
#
/sw/tools/matlab/7.0.1/man
/sw/tools/gnat/5.01a/man
#

I would like to get it like this:

/sw/tools/matlab/7.0.1/man:/sw/tools/gnat/5.01a/man

Is awk the command to pipe the output to, and if so, how can I solve this?


Thanks to You that replys...
  #2 (permalink)  
Old 03-30-2005
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,119
find ..... | tr '\n' ':'

or with nawk:
find ..... | nawk -v ORS=':' '1'
  #3 (permalink)  
Old 03-30-2005
tonlu tonlu is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 16
Great!! -Thanks... You saved my day.
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:02 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
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