[SLE] Problem with script erasing first possible space from a line

From: jaakko tamminen (jaakko.tamminen_at_co.inet.fi)
Date: Tue Oct 15 2002 - 14:27:59 CEST

  • Next message: zentara: "Re: [SLE] KMail and replying to list"
    From: jaakko tamminen <jaakko.tamminen@co.inet.fi>
    Date: Tue, 15 Oct 2002 15:27:59 +0300
    Message-Id: <200210151527.59666.jaakko.tamminen@co.inet.fi>
    Subject: [SLE] Problem with script erasing first possible space from a line
    

    Hi

    Whe I do following:
    ps ax|grep 'home-main'|grep tun|cut -f1 -d' '
    I get the process ID of the line:
    31328 ? S< 0:00 vtund[c]: home-main tun tun1

    But, if there is a space before the process-ID (ID under 9999), then the last
    script command "cut -f1 -d' '" does not work, because it will see the first
    space as a delimiter.

    How can I erase the leading space(s) from that line, so the "cut" command
    would work with space in front of the line?

    Or better yet, is there another (better?) way to get a process-id with program
    name and its parameter-line

    Jaska.

    -- 
    Check the headers for your unsubscription address
    For additional commands send e-mail to suse-linux-e-help@suse.com
    Also check the archives at http://lists.suse.com
    Please read the FAQs: suse-linux-e-faq@suse.com
    


    This archive was generated by hypermail 2.1.4 : Tue Oct 15 2002 - 14:32:32 CEST