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. Advertisements

  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. Advertisements

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:
    1,074
    U. George
    Aug 11, 2005
  2. Matrix Resource Partners, Inc.

    [Seattle, WA] Developer Needed with C, Perl, Python and Linux Experience

    Matrix Resource Partners, Inc., Aug 27, 2003, in forum: C Programming
    Replies:
    3
    Views:
    440
    Mike Wahler
    Aug 29, 2003
  3. astro
    Replies:
    5
    Views:
    826
    astro
    Dec 9, 2004
  4. Replies:
    0
    Views:
    418
  5. My Python
    Replies:
    3
    Views:
    1,353
    My Python
    Jun 16, 2010
  6. Ant
    Replies:
    28
    Views:
    982
    Lie Ryan
    Sep 26, 2010
  7. patrickwayodi
    Replies:
    6
    Views:
    1,133
    Anssi Saari
    Dec 14, 2011
  8. Krishna Chaitanya
    Replies:
    1
    Views:
    285
    Krishna Chaitanya
    Feb 27, 2009
Loading...