Loading ...
Sorry, an error occurred while loading the content.

Re: [redhat] Re: find

Expand Messages
  • Scott
    ... Ah, I see. Thank you as always. -- Scott Robbins PGP keyID EB3467D6 ( 1B48 077D 66F6 9DB0 FDC2 A409 FA54 EB34 67D6 ) gpg --keyserver pgp.mit.edu
    Message 1 of 22 , Apr 30, 2007
    • 0 Attachment
      On Tue, May 01, 2007 at 11:48:54AM +1000, Cameron Simpson wrote:
      > On 30Apr2007 19:45, Scott <scottro@...> wrote:
      > | Cameron, is there any preference between quotes and braces, i.e.,
      > | between "$i" and ${i}? My custom is usually ${i}, probably a habit from
      > | an old shellscripting book.
      >
      > ${} and quotes are unrelated issues. (And {} glob expansion, per
      > Godwin's example, is yet a third unrelated synax).
      >
      > I dislike ${i}; I think it is harder to read. I reserve curlies for when
      > I need to disambiguate something, eg:
      >
      > echo ${i}foo
      >
      > to prevent if reading as $ifoo, not what was intended. And of course the
      > extra substituion modes that ${} permits like ${HOSTNAME:-`hostname`}.

      Ah, I see. Thank you as always.


      --

      Scott Robbins

      PGP keyID EB3467D6
      ( 1B48 077D 66F6 9DB0 FDC2 A409 FA54 EB34 67D6 )
      gpg --keyserver pgp.mit.edu --recv-keys EB3467D6

      Spike: Where have you been pet?
      Drusilla: I went for a walk. I met an old man. I didn't like him,
      he got stuck in my teeth.
    • Godwin Stewart
      ... Hash: SHA1 On Tue, 1 May 2007 08:34:01 +1000, Cameron Simpson ... Probably not. However, this was posted to the redhat@yahoogroups.com
      Message 2 of 22 , May 1, 2007
      • 0 Attachment
        -----BEGIN PGP SIGNED MESSAGE-----
        Hash: SHA1

        On Tue, 1 May 2007 08:34:01 +1000, Cameron Simpson <cs@...>
        wrote:

        > | $ for i in q[1-3]; do mv -v {,wil.}$i; done
        >
        > Is that portable?

        Probably not.

        However, this was posted to the redhat@yahoogroups.com mailing list, so
        we can assume that the user is using Red Hat or a derivative thereof.
        Furthermore, it's a relatively newbie question, so it's also safe to
        assume that the OP hasn't set up a shell other than the default: bash.

        Otherwise, (s)he posted to the wrong list and should therefore not be
        surprised if the information given is not valid for hir O/S.

        - --
        G. Stewart - gstewart@...

        This door is baroquen, please wiggle Handel.
        (If I wiggle Handel, will it wiggle Bach?)
        -- Found on a door in the MSU music building
        -----BEGIN PGP SIGNATURE-----
        Version: GnuPG v1.4.1 (GNU/Linux)

        iD8DBQFGNv0WK5oiGLo9AcYRAowDAJ4hVOgBmj7bFZFNG+UauuIax+WyYwCfdaJY
        bDssFpOahsJFM2A4hliopdg=
        =8oO0
        -----END PGP SIGNATURE-----
      • y.nikhileshwar
        i have a files a b c b i have changed those files to a.sql b.sql c.sql d.sql by using find command by find . -exec mv {} {}.sql ; but i want to change the
        Message 3 of 22 , May 3, 2007
        • 0 Attachment
          i have a files a b c b


          i have changed those files to a.sql b.sql c.sql d.sql by using
          find command by find . -exec mv {} {}.sql \;
          but i want to change the files to sql.a sql.b sql.c sql.b but iam
          unable to change the files using find command .plz give me the solution
        • Godwin Stewart
          ... Hash: SHA1 On Thu, 03 May 2007 07:41:50 -0000, y.nikhileshwar ... NO!!! Oh, c mon now. I m 100% certain that you were given the solution above instead of
          Message 4 of 22 , May 3, 2007
          • 0 Attachment
            -----BEGIN PGP SIGNED MESSAGE-----
            Hash: SHA1

            On Thu, 03 May 2007 07:41:50 -0000, "y.nikhileshwar"
            <y.nikhileshwar@...> wrote:

            > i have changed those files to a.sql b.sql c.sql d.sql by using
            > find command by find . -exec mv {} {}.sql \;
            > but i want to change the files to sql.a sql.b sql.c sql.b but iam
            > unable to change the files using find command .plz give me the
            > solution

            NO!!!

            Oh, c'mon now. I'm 100% certain that you were given the solution above
            instead of working it out for yourself. Why? Because you don't have a
            frelling clue how it works. If you did understand it, you wouldn't have
            asked this question.

            Work out how the command you cited above works. Then you'll have the
            answer to your question.

            - --
            G. Stewart - gstewart@...

            Light travels faster than sound. That is why some people appear bright
            until you hear them speak.
            -----BEGIN PGP SIGNATURE-----
            Version: GnuPG v1.4.1 (GNU/Linux)

            iD8DBQFGObc1K5oiGLo9AcYRApYeAJ4835tgNs13Di3I+Z8kqQ7CUluiUgCdGkEa
            aFJIOxaTAuqXAViefnbGo0Q=
            =Brp5
            -----END PGP SIGNATURE-----
          • y.nikhileshwar
            i have a files a b c b i have changed those files to a.sql b.sql c.sql d.sql by using find command by find . -exec mv {} {}.sql ; but i want to change the
            Message 5 of 22 , May 24, 2007
            • 0 Attachment
              i have a files a b c b


              i have changed those files to a.sql b.sql c.sql d.sql by using
              find command by find . -exec mv {} {}.sql \;
              but i want to change the files to sql.a sql.b sql.c sql.b but iam
              unable to change the files using find command .plz give me the solution
            • Godwin Stewart
              ... Hash: SHA1 On Thu, 24 May 2007 07:02:07 -0000, y.nikhileshwar ... We ve already been through this. Understand how the first find command works and you ll
              Message 6 of 22 , May 24, 2007
              • 0 Attachment
                -----BEGIN PGP SIGNED MESSAGE-----
                Hash: SHA1

                On Thu, 24 May 2007 07:02:07 -0000, "y.nikhileshwar"
                <y.nikhileshwar@...> wrote:

                > i have a files a b c b
                >
                >
                > i have changed those files to a.sql b.sql c.sql d.sql by using
                > find command by find . -exec mv {} {}.sql \;
                > but i want to change the files to sql.a sql.b sql.c sql.b but iam
                > unable to change the files using find command .plz give me the
                > solution

                We've already been through this.

                Understand how the first find command works and you'll have the answer
                to your question. Someone just giving you the answer is not going to
                help you because you're going to come back asking the same thing time
                and time again each time there's a small variant in what you need to do.

                Don't be so damn lazy. Try and figure out how 'find' works.

                - --
                G. Stewart - gstewart@...

                And 1.1.81 is officially BugFree(tm), so if you receive any bug-reports
                on it, you know they are just evil lies.
                -- Linus Torvalds
                -----BEGIN PGP SIGNATURE-----
                Version: GnuPG v1.4.7 (GNU/Linux)

                iD8DBQFGVU03K5oiGLo9AcYRAlTyAKCrNVDF94nfpa5iHYcPS+3duWjS6wCfb3MQ
                wf4ksQDkZV5NtooPSXak35k=
                =FSpC
                -----END PGP SIGNATURE-----
              • y.nikhileshwar
                is it possible to use options maxdepth and mindepth both at a time in find command ,i have tried but iam not getting the output .i have 10 multilevel
                Message 7 of 22 , May 25, 2007
                • 0 Attachment
                  is it possible to use options maxdepth and mindepth both at a time
                  in find command ,i have tried but iam not getting the output .i have
                  10 multilevel directories in that iam using the command and iam
                  copying a file into that by using this command


                  find . -maxdepth 2 -mindepth 1 -type d -exec cp john {} \;

                  can i use the command like this,can i perform any arthimetic
                  caliculations with maxdepth & mindepth like maxdepth +2 and mindepth -3
                Your message has been successfully submitted and would be delivered to recipients shortly.