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
Creating a file in variable length format Sarahb29 UNIX for Dummies Questions & Answers 2 04-22-2008 08:07 AM
What the command to find out the record length of a fixed length file? tranq01 UNIX for Dummies Questions & Answers 3 10-19-2007 11:16 AM
Awk with fixed length files c2b2 Shell Programming and Scripting 7 01-06-2007 08:57 AM
fixed length fields in awk roopla Shell Programming and Scripting 2 11-13-2006 05:12 PM
fixed record length george_ Shell Programming and Scripting 16 03-28-2006 02:41 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-03-2003
Registered User
 

Join Date: Jun 2003
Posts: 10
Stumble this Post!
creating a fixed length output from a variable length input

Is there a command that sets a variable length?

I have a input of a variable length field but my output for that field needs to be set to 32 char.

Is there such a command?

I am on a sun box running ksh


Thanks
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-03-2003
linuxpenguin's Avatar
Registered User
 

Join Date: May 2002
Location: India
Posts: 295
Stumble this Post!
Hi,
did not really get what you are looking for.

but if you want to trim a particular variable value there are many ways to do it

eg

output=echo $variable|awk '{substr(startpos,endpos,$0)}'

hope this helps
__________________
War doesnt determine who is right, it determines who is left
Reply With Quote
  #3 (permalink)  
Old 12-03-2003
Ygor's Avatar
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,243
Stumble this Post!
typeset -L32 Variable
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01: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