Ask a Question related to Linux / Unix Administration, Design and Development.

  1. #1

    Default shell script help!!

    hi all,

    i have some commands on hand, but i don't know how i can stick it up
    with (ksh) shell script... can anyone help?

    1) use find to list out last 6 modified day files, *.zip
    find /directory -mtime -6 -name '*.zip'
    2) name of file is unknown, but i need to make up the following
    command so i could attach all files and send it out into one email
    (uuencode $1 `basename $1`; uuencode $2 `basename $2`..... uuencode $X
    `basename $1X`) | mail [email]hello@hotmail.com[/email]

    how can i do it?

    thanks
    Louis Guest

  2. Similar Questions and Discussions

    1. Shell script question
      Hi, I am trying to run one of my installation shell script using the command- bash resetapp.sh & it gives me the error as- 'bash: not...
    2. Shell Script Examples
      On 3 Feb 2004 02:51:42 -0800, sysera wrote: This is for bash, but is kinda close to ksh. http://www.tldp.org/LDP/abs/html/index.html...
    3. How do i include a shell script
      How do i include a shell script in perl. I have to use some shell scripts in a perl script. I know I can write it in perl, but would like avoid...
    4. shell script with different results
      I'd like to get an IP address from network. See the following line. I'd received the correct address if I start the script from root/shell but...
    5. Execute shell script from a perl script
      Hi, How can I executed a Unix shell script from a Perl script. The shell script is a dump of a oracle table to a file. The perl script is for...
  3. #2

    Default Re: shell script help!!

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1
    NotDashEscaped: You need GnuPG to verify this message

    In comp.unix.shell Louis <louiskkchan@hotmail.com> suggested:
    > hi all,
    > i have some commands on hand, but i don't know how i can stick it up
    > with (ksh) shell script... can anyone help?
    > 1) use find to list out last 6 modified day files, *.zip
    > find /directory -mtime -6 -name '*.zip'
    > 2) name of file is unknown, but i need to make up the following
    > command so i could attach all files and send it out into one email
    > (uuencode $1 `basename $1`; uuencode $2 `basename $2`..... uuencode $X
    > `basename $1X`) | mail [email]hello@hotmail.com[/email]
    > how can i do it?
    find . -mtime -6 -name '*.zip' | tar -cvzf files.tar.gz -T -

    Now pipe files.tar.gz via uuencode to mail.

    --
    Michael Heiming (GPG-Key ID: 0xEDD27B94)
    mail: echo [email]zvpunry@urvzvat.qr[/email] | perl -pe 'y/a-z/n-za-m/'
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.4 (GNU/Linux)

    iD8DBQFBHH7fAkPEju3Se5QRAn0xAKCvaXNLZGnoaxwhRBwZf7 7GJVjAKgCfYT+b
    fEYpa4T/4UaBkoVy8JcM3ZI=
    =hXMt
    -----END PGP SIGNATURE-----
    Michael Heiming Guest

  4. #3

    Default Re: shell script help!!

    Michael Heiming <michael+USENET@www.heiming.de> wrote in message news:<0gbuu1-oih.ln1@news.heiming.de>...
    > -----BEGIN PGP SIGNED MESSAGE-----
    > Hash: SHA1
    > NotDashEscaped: You need GnuPG to verify this message
    >
    > In comp.unix.shell Louis <louiskkchan@hotmail.com> suggested:
    > > hi all,
    >
    > > i have some commands on hand, but i don't know how i can stick it up
    > > with (ksh) shell script... can anyone help?
    >
    > > 1) use find to list out last 6 modified day files, *.zip
    > > find /directory -mtime -6 -name '*.zip'
    > > 2) name of file is unknown, but i need to make up the following
    > > command so i could attach all files and send it out into one email
    > > (uuencode $1 `basename $1`; uuencode $2 `basename $2`..... uuencode $X
    > > `basename $1X`) | mail [email]hello@hotmail.com[/email]
    >
    > > how can i do it?
    >
    > find . -mtime -6 -name '*.zip' | tar -cvzf files.tar.gz -T -
    >
    > Now pipe files.tar.gz via uuencode to mail.
    >
    tar -cvf - $( find /directory -mtime -6 -name \*.zip -print ) |
    compress -c | uuencode zipfiles.tar.Z | mail -s "zip files"
    [email]hello@hotmail.com[/email]

    Or use "gzip -c " to compress and change the uuencoded file extension
    to "tar.gz"



    --------------------------------------------------------
    Dana French [email]dfrench@mtxia.com[/email]
    Mt Xia Technical Consulting Group [url]http://www.mtxia.com[/url]
    100% Spam Free Email [url]http://www.ridmail.com[/url]
    MicroEmacs [url]http://uemacs.tripod.com[/url]
    Korn Shell Web [url]http://dfrench.tripod.com/kshweb.html[/url]
    Dana French Guest

  5. #4

    Default Re: shell script help!!

    thanks all, so seems zip/gzip all files into one and then uuencode it
    is the only solution instead of multiple attachment.



    [email]dfrench@mtxia.com[/email] (Dana French) wrote in message news:<3fa52bda.0408130751.4690c501@posting.google. com>...
    > Michael Heiming <michael+USENET@www.heiming.de> wrote in message news:<0gbuu1-oih.ln1@news.heiming.de>...
    > > -----BEGIN PGP SIGNED MESSAGE-----
    > > Hash: SHA1
    > > NotDashEscaped: You need GnuPG to verify this message
    > >
    > > In comp.unix.shell Louis <louiskkchan@hotmail.com> suggested:
    > > > hi all,
    >
    > > > i have some commands on hand, but i don't know how i can stick it up
    > > > with (ksh) shell script... can anyone help?
    >
    > > > 1) use find to list out last 6 modified day files, *.zip
    > > > find /directory -mtime -6 -name '*.zip'
    > > > 2) name of file is unknown, but i need to make up the following
    > > > command so i could attach all files and send it out into one email
    > > > (uuencode $1 `basename $1`; uuencode $2 `basename $2`..... uuencode $X
    > > > `basename $1X`) | mail [email]hello@hotmail.com[/email]
    >
    > > > how can i do it?
    > >
    > > find . -mtime -6 -name '*.zip' | tar -cvzf files.tar.gz -T -
    > >
    > > Now pipe files.tar.gz via uuencode to mail.
    > >
    >
    > tar -cvf - $( find /directory -mtime -6 -name \*.zip -print ) |
    > compress -c | uuencode zipfiles.tar.Z | mail -s "zip files"
    > [email]hello@hotmail.com[/email]
    >
    > Or use "gzip -c " to compress and change the uuencoded file extension
    > to "tar.gz"
    >
    >
    >
    > --------------------------------------------------------
    > Dana French [email]dfrench@mtxia.com[/email]
    > Mt Xia Technical Consulting Group [url]http://www.mtxia.com[/url]
    > 100% Spam Free Email [url]http://www.ridmail.com[/url]
    > MicroEmacs [url]http://uemacs.tripod.com[/url]
    > Korn Shell Web [url]http://dfrench.tripod.com/kshweb.html[/url]
    Louis Guest

  6. #5

    Default Re: shell script help!!

    On 2004-08-14, Louis <louiskkchan@hotmail.com> wrote:
    > thanks all, so seems zip/gzip all files into one and then uuencode it
    > is the only solution instead of multiple attachment.
    [snip: please don't top-post. see rfc1855]

    Certainly not. You could use shar to create a ``sharchive''. You could
    use mime tools to create a multipart mime message from the commandline.
    tar(+gzip or bzip2) or zip and then uuencode, however, is one of the
    easiest to implement. And having a compression step seems like a good
    idea to keep the message size down.


    --
    j p d (at) d s b (dot) t u d e l f t (dot) n l .
    jpd Guest

  7. #6

    Default Re: shell script help!!

    jpd <read_the_sig@do.not.spam.it> wrote in message news:<1092479271.657815@entelocal.ipberlin.com>...
    > Certainly not. You could use shar to create a ``sharchive''. You could
    > use mime tools to create a multipart mime message from the commandline.
    > tar(+gzip or bzip2) or zip and then uuencode, however, is one of the
    > easiest to implement. And having a compression step seems like a good
    > idea to keep the message size down.
    umm... i could be able to send "(uuencode a.zip; uuencode b.zip;
    uuencode c.zip) | mail [email]myemail@here.com[/email]" to Notes server and this mail
    with multiple attachment could be viewed probably under Notes.

    in fact, those files zipped already. so zip it once again help on
    'uuencode'
    Louis Guest

  8. #7

    Default Re: shell script help!!

    Louis wrote:
    > umm... i could be able to send "(uuencode a.zip; uuencode b.zip;
    > uuencode c.zip) | mail [email]myemail@here.com[/email]" to Notes server and this mail
    > with multiple attachment could be viewed probably under Notes.
    That may be true, but those uuencoded files are not attachments since
    the mail command does not generate the appropriate MIME headers to
    identify them as such.
    > in fact, those files zipped already. so zip it once again help on
    > 'uuencode'
    Huh?

    --
    Kevin Rodgers

    Kevin Rodgers Guest

  9. #8

    Default Re: shell script help!!

    Kevin Rodgers <ihs_4664@yahoo.com> wrote in message news:<4120EC13.9060302@yahoo.com>...
    > That may be true, but those uuencoded files are not attachments since
    > the mail command does not generate the appropriate MIME headers to
    > identify them as such.
    fyi, Notes is able to view it and detach it.
    Louis Guest

  10. #9

    Default Re: shell script help!!

    On 17 Aug 2004 23:11:35 -0700, Louis <louiskkchan@hotmail.com> wrote:
    >
    >
    > Kevin Rodgers <ihs_4664@yahoo.com> wrote in message news:<4120EC13.9060302@yahoo.com>...
    >
    >> That may be true, but those uuencoded files are not attachments since
    >> the mail command does not generate the appropriate MIME headers to
    >> identify them as such.
    >
    > fyi, Notes is able to view it and detach it.
    Why not? Easy enough to scan the body and make a guess as to the file type,
    if not ascertain it for sure.

    Notes (which I've never heard of) determines that the body is a uuencoded
    jpeg (for example) and decodes it and sends it to a viewer.

    AC


    Alan Connor Guest

  11. #10

    Default Re: shell script help!!

    oh... u don't know Lotus Notes [url]http://www-306.ibm.com/software/lotus/[/url] ??

    "Alan Connor" <zzzzzz@xxx.yyy> wrote in message
    news:EyCUc.26508$9Y6.1979@newsread1.news.pas.earth link.net...
    > Notes (which I've never heard of) determines that the body is a uuencoded
    > jpeg (for example) and decodes it and sends it to a viewer.
    >
    > AC
    >
    >

    Louis Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139