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
replacing multiple lines with single line siba.s.nayak Shell Programming and Scripting 3 05-28-2008 02:43 AM
Separate lines in a single '|' separated line hidnana Shell Programming and Scripting 3 03-17-2008 10:16 AM
Multi-line output to single line LinuxRacr Shell Programming and Scripting 7 02-26-2008 10:05 AM
Joining lines to single line in VI bobo UNIX for Dummies Questions & Answers 10 01-16-2006 11:30 AM
Splitting a single line into multiple lines thanuman Shell Programming and Scripting 4 02-23-2005 04:56 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-08-2006
csaha's Avatar
csaha csaha is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 81
Need output in different lines not in one single line

I am getting the coutput like this as show below in one single line, where as the command is executed is several lines and the output should also be requied in several lines, not in one single line.

Anyone any idea?

Code:
p4 opened -a | grep *locked* | awk '{ printf $8 }' >/tmp/aa

Code:
$ cat /tmp/aa
byapeleg@AlonPeleg-1(text)csaha@test_depo_csahacsaha@test_depo_csahacsaha@test_depo_csahamanomugdha@home_guest_bkup_manomugdha_IxManomanomugdha@home_guest_bkup_manomugdha_IxManomanomugdha@home_guest_bkup_manomugdha_IxManomanomugdha@home_guest_bkup_manomugdha_IxManomanomugdha@home_guest_bkup_manomugdha_IxManomanomugdha@home_guest_bkup_manomugdha_IxManomanomugdha@home_guest_bkup_manomugdha_IxManomanomugdha@home_guest_bkup_manomugdha_IxManomanomugdha@home_guest_bkup_manomugdha_IxManomanomugdha@home_guest_bkup_manomugdha_IxManomanomugdha@home_guest_bkup_manomugdha_IxManomanomugdha@home_guest_bkup_manomugdha_IxManomanomugdha@home_guest_bkup_manomugdha_IxManorjongbloed@rjongbloed-ixmobile-vt-mainrjongbloed@rjongbloed-ixmobile-vt-mainqtrinh
Code:
Required output is like this 

$ cat /tmp/aa
byapeleg@AlonPeleg-1(text)csaha@test_depo_csaha
csaha@test_depo_csaha
csaha@test_depo_csaha
manomugdha@home_guest_bkup_mano
mugdha_IxManomanomugdha@home_guest_bkup_mano
mugdha_IxManomanomugdha@home_guest_bkup_mano
mugdha_IxManomanomugdha@home_guest_bkup_mano
mugdha_IxManomanomugdha@home_guest_bkup_mano
mugdha_IxManomanomugdha
.
.
.
and so on ...
  #2 (permalink)  
Old 02-08-2006
mahendramahendr mahendramahendr is offline Forum Advisor  
Registered User
  
 

Join Date: Dec 2005
Location: London
Posts: 222
In awk :

printf don't includes new line character, you need to specifically include "\n" in the command...

otherwise you can use print instead of printf which by default adds new line character in the end.
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 11:26 PM.


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