[HPADM] Outputting blanks in a variable

From: Buddy Mills (ramill_at_wm.edu)
Date: 05/24/05

  • Next message: Buddy Mills: "[HPADM] Re: Outputting blanks in a variable - Solution"
    To: <hpux-admin@dutchworks.nl>
    Date: Tue, 24 May 2005 15:14:16 -0400
    
    

    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)
    

  • Next message: Buddy Mills: "[HPADM] Re: Outputting blanks in a variable - Solution"

    Relevant Pages

    • Re: char* argv[]
      ... Your second program thinks argv is a string, ... *first element* in an array of characters. ...
      (comp.lang.c)
    • Re: char* argv[]
      ... Your second program thinks argv is a string, ... an array of characters. ...
      (comp.lang.c)