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

shell scripts to copy files

Expand Messages
  • Nguyen, David M
    I write a shell script not perl script to copy every files under certain directories not ALL directories on my disk drive, how do I do that with shell script
    Message 1 of 8 , Mar 8, 2002
    • 0 Attachment
      I write a shell script not perl script to copy every files under certain
      directories not ALL directories on my disk drive, how do I do that with
      shell script using unix command? For example, copy every files EXCEPT ( or
      IGNORE) this directory.

      By the way, does someone know if there is a mailing list for UNIX users?

      Thanks,
      David
    • Daryl Shute
      A while ago someone here had a signature file that was 2 lines of perl code. It looked to me like Unicode, and said something like: unpack (U*/243/216
      Message 2 of 8 , Mar 8, 2002
      • 0 Attachment
        A while ago someone here had a signature file that was 2 lines of perl code.
        It looked to me like Unicode, and said something like: unpack (U*/243/216
        etc,etc).
        I ran it and it printed "Another Perl Programmer" to the screen.
        Could someone let me know if there are any webpages that give directions on
        how to do this kind of coding?

        Thanks!!
      • Jonathan E. Paton
        ... You mean Unicode or the JAPH (Just Another Perl Hacker)? For the former: perldoc -f unpack perldoc -f pack perldoc perlunicode perldoc perllocale If it s
        Message 3 of 8 , Mar 8, 2002
        • 0 Attachment
          > Could someone let me know if there are any
          > webpages that give directions on how to do
          > this kind of coding?

          You mean Unicode or the JAPH (Just Another
          Perl Hacker)?

          For the former:

          perldoc -f unpack
          perldoc -f pack
          perldoc perlunicode
          perldoc perllocale

          If it's the latter then join fwp@...
          without delay, and they'll make sure you know
          your }{ from your ~~

          fwp@... requires a boss who isn't too
          stringent, or you are jobseeking anyway, as the
          monthy Perl Golf competitions are both addictive
          and very difficult to convice your boss they
          constitute "real work".

          Jonathan PAton

          __________________________________________________
          Do You Yahoo!?
          Everything you'll ever need on one web page
          from News and Sport to Email and Music Charts
          http://uk.my.yahoo.com
        • sgharms@obsidiansunrise.net
          ... Hash: SHA1 Daryl Shute writes: Daryl, This is a very common thing amongst perl programmers. The most common sig results is Just
          Message 4 of 8 , Mar 8, 2002
          • 0 Attachment
            -----BEGIN PGP SIGNED MESSAGE-----
            Hash: SHA1

            "Daryl Shute" <daryl.shute@...> writes:

            Daryl,

            This is a very common thing amongst perl programmers. The most
            common sig results is "Just Another Perl Hacker", which you can
            read all about in the Camel book.

            This is commonly abbreviated as JAPH and is likely the source of
            the frequent poster "Japhy" 's name.

            steven

            > A while ago someone here had a signature file that was 2 lines of perl code.
            > It looked to me like Unicode, and said something like: unpack (U*/243/216
            > etc,etc).
            > I ran it and it printed "Another Perl Programmer" to the screen.
            > Could someone let me know if there are any webpages that give directions on
            > how to do this kind of coding?
            >
            > Thanks!!
            >
            >
            >
            > Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
            >
            > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
            >
            >
            >

            - --
            http://www.obsidiansunrise.net
            -----BEGIN PGP SIGNATURE-----
            Version: GnuPG v1.0.6 (GNU/Linux)
            Comment: Processed by Mailcrypt 3.5.6 and Gnu Privacy Guard <http://www.gnupg.org/>

            iD8DBQE8iWuD0Fa/d+hASL8RAgtlAKCmDUzZ2uxA66hlkHVxAHagVher0wCdFcDP
            PsCjNHbEgYMgKjyJHLA+/+E=
            =kboD
            -----END PGP SIGNATURE-----
          • daymobrew
            I think it would be easier to do this in perl. You could use the find function in the File::Find module. In the function that receives the names of the found
            Message 5 of 8 , Mar 9, 2002
            • 0 Attachment
              I think it would be easier to do this in perl.
              You could use the find function in the File::Find module.
              In the function that receives the names of the found files you can
              m// to see if it is in a directory you wish to exclude.

              Not sure how you'd do it in a shell script.

              --- In perl-beginner@y..., "Nguyen, David M" <david.m.nguyen@x> wrote:
              > I write a shell script not perl script to copy every files under
              certain
              > directories not ALL directories on my disk drive, how do I do that
              with
              > shell script using unix command? For example, copy every files
              EXCEPT ( or
              > IGNORE) this directory.
              >
              > By the way, does someone know if there is a mailing list for UNIX
              users?
              >
              > Thanks,
              > David
            • Jonathan E. Paton
              ... Not really. ... True ... find / -name * | grep -v ^/dev/ | while read a; do cp $a /backup$a; next I m hazy on the while syntax, but it goes something
              Message 6 of 8 , Mar 9, 2002
              • 0 Attachment
                > I think it would be easier to do this in perl.

                Not really.

                > You could use the find function in the File::Find
                > module. In the function that receives the names
                > of the found files you can m// to see if it is in
                > a directory you wish to exclude.

                True

                > Not sure how you'd do it in a shell script.

                find / -name '*' | grep -v '^/dev/' | while read a; do
                cp $a /backup$a; next

                I'm hazy on the while syntax, but it goes something like
                that - you can just keep sticking in grep's until you
                are happy.

                Jonathan Paton

                __________________________________________________
                Do You Yahoo!?
                Everything you'll ever need on one web page
                from News and Sport to Email and Music Charts
                http://uk.my.yahoo.com
              • fergus
                have to confess - i didn t really understand the original post but i would do this ; ... like this ; find /dev | cpio -pd -C /backup or use of other favorite
                Message 7 of 8 , Mar 9, 2002
                • 0 Attachment
                  have to confess - i didn't really understand the original post but i
                  would do this ;

                  > find / -name '*' | grep -v '^/dev/' | while read a; do
                  > cp $a /backup$a; next

                  like this ;

                  find /dev | cpio -pd -C /backup

                  or use of other favorite archive util in a pipe.
                • fergus
                  ... oops. ignore the -C option; got my utils mixed up.
                  Message 8 of 8 , Mar 9, 2002
                  • 0 Attachment
                    > find /dev | cpio -pd -C /backup

                    oops. ignore the '-C' option; got my utils mixed up.
                  Your message has been successfully submitted and would be delivered to recipients shortly.