[HPADM] Outputting blanks in a variable

From: Buddy Mills (ramill@wm.edu)
Date: Tue May 24 2005 - 15:14:16 EDT


Hello all, This is hard to explain but I will try.

   I am trying to send a string of variable to a file used later in second program. The second program is expecting to see each variable in a certain position(s) The problem arises when I have a variable that is a random length.

Example
test=`cat /kfile|cut -c5-11`
name=`cat /kfile|cut -c12-42`
test2=`cat /kfile|cut -c1-4`

kfile
testtest012lastname,firstm (name,firstm varies)

echo $test$name$test2 > newfile

When $name varies in size, even thought I cut the same position including blanks, the blanks are not represented in the outputfile (newfile) which then put "test2" in the wrong position.

I have done this before, but have since misplace the solution.

Thanks in advance,

Buddy Mills
The College of William and Mary
757-221-2099 ramill@wm.edu

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:47 EDT