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
newline character trichyselva UNIX for Dummies Questions & Answers 9 10-31-2008 01:47 PM
Concatenate the string with the newline character youareapkman Shell Programming and Scripting 3 09-16-2008 09:23 AM
Sed append newline character Gaurang033 Shell Programming and Scripting 3 06-26-2008 05:57 AM
Newline character not working for ksh sanikv Shell Programming and Scripting 11 06-23-2005 01:34 PM
How can I replace newline character? ghoti UNIX for Dummies Questions & Answers 1 08-16-2001 12:49 PM

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 11-10-2008
srilaxmi srilaxmi is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 21
echo without newline character

hi,

I have a for loop where in I write some file name to another file.
I want to write all the filenames to another without any newlines. how can i avoid getting new lines with echo?

Thanks,
Srilaxmi
  #2 (permalink)  
Old 11-10-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,717
Depends on your system try one of:
Code:
echo "text \c"
# or
echo -n "text "
  #3 (permalink)  
Old 11-10-2008
joeyg's Avatar
joeyg joeyg is offline Forum Staff  
modérateur
  
 

Join Date: Dec 2007
Location: Home of 17-time world champion Boston Celtics
Posts: 1,311
Wink printf command

You should also explore the printf command, as in a command below:

printf "%-8s|%-20s\n" "$zf" "$unique" >>file4

I write two variables $zf and $unique to my file4, with fixed spacing and a | character between the two fields.
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 01:03 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