The UNIX and Linux Forums  

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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Adding character to spaces in a table Raynon Shell Programming and Scripting 15 05-23-2008 08:08 PM
Adding spaces to record nvenkat010 Shell Programming and Scripting 3 01-28-2008 09:24 AM
adding spaces to a line mgirinath Shell Programming and Scripting 4 03-23-2007 08:38 AM
Strip leading and trailing spaces only in a shell variable with embedded spaces jerardfjay Shell Programming and Scripting 6 03-07-2005 10:24 AM
Adding Trailing Spaces to a file 222001459 UNIX for Dummies Questions & Answers 1 11-04-2004 11:23 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-25-2008
Registered User
 

Join Date: Jan 2007
Posts: 17
adding spaces for a variable value

Hi,

i have to form the header and add fillers(spaces) to it.

I have done something like this. i have added 10 spaces at the end

HDR="AAAABBBBCCNN "
echo $HDR >> file1.dat

but the spaces are not being stored in the file. How to add the spaces.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-25-2008
robotronic's Avatar
Can I play with madness?
 

Join Date: Apr 2002
Location: Italy
Posts: 370
Put double quotes around the variable:
Code:
echo "$HDR" >> file1.dat
Reply With Quote
  #3 (permalink)  
Old 02-26-2008
Registered User
 

Join Date: Jan 2007
Posts: 17
Thanks a lot. This solved my problem.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 10:19 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0