Re: Linux - python vs sh

Discussion in 'Python' started by Sybren Stuvel, Jul 17, 2003.

  1. Krisztian Kepes enlightened us with:
    > I want to list my rpm database to file with this:


    Besides the answers you already got, you might like this too:

    > echo '>>>>>>>>>>>>>>>' >>$file
    > echo "$nr." >>$file
    > echo "Name: $rpmname" >>$file
    > echo "" >>$file
    > info=`rpm -qi $rpmname`
    > echo "$info" >>$file
    > echo "" >>$file


    can be re-written as:

    (
    echo '>>>>>>>>>>>>>>>>'
    echo "$nr."
    echo "Name: $rpmname"
    echo
    rpm -qi $rpmname
    echo
    ) >> $file

    Sybren
    --
    The problem with the world is stupidity. Not saying there should be a
    capital punishment for stupidity, but why don't we just take the
    safety labels off of everything and let the problem solve itself?
    Sybren Stuvel, Jul 17, 2003
    #1
    1. Advertising

  2. In article <>,
    Sybren Stuvel <> wrote:
    .
    .
    .
    >can be re-written as:
    >
    >(
    > echo '>>>>>>>>>>>>>>>>'
    > echo "$nr."
    > echo "Name: $rpmname"
    > echo
    > rpm -qi $rpmname
    > echo
    >) >> $file

    .
    .
    .
    .... or, for that matter,
    echo ">>>>>>>>>>>>>>>>
    $nr.
    Name: $rpmname

    `rpm -qi $rpmname

    " >> $file
    among other variants.
    --

    Cameron Laird <>
    Business: http://www.Phaseit.net
    Personal: http://phaseit.net/claird/home.html
    Cameron Laird, Jul 17, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. U. George
    Replies:
    4
    Views:
    835
    U. George
    Aug 11, 2005
  2. astro
    Replies:
    5
    Views:
    624
    astro
    Dec 9, 2004
  3. Replies:
    0
    Views:
    334
  4. My Python
    Replies:
    3
    Views:
    1,078
    My Python
    Jun 16, 2010
  5. Krishna Chaitanya
    Replies:
    1
    Views:
    138
    Krishna Chaitanya
    Feb 27, 2009
Loading...

Share This Page