problems piping from "split" to "mail" (split | mail)

problems piping from "split" to "mail" (split | mail)

Post by Dave Bro » Fri, 24 Nov 1995 04:00:00





: Hi !
:
: Can anybody give me a hint why the following doesnt work?
:

:
: Piping from uuencode to split works flawless (checked it with "tee"), but
: something doesnt work out in piping from split to mail. What happens is:
: the   uuencoded file gets split up correctly (lets assume its split into
: four pieces) and four mails are sent of to the correct address, but they
: are empty. Instead the four files are found on disk. Any ideas?

Yeah, you didn't read the man page for split:

 split(1)
split(1)

 NAME
      split - split a file into pieces

 SYNOPSIS
      split [-l line_count] [-a suffix_length] [file [name]]

      split [-b n[k|m]] [-a suffix_length] [file [name]]

      Obsolescent:
      split [-n] [file [name]]

 DESCRIPTION
      split reads file and writes it in pieces (default 1000 lines) onto a
      set of output files.  [...]

*sigh*

--Dave
--
http://armf18.dow.on.doe.ca:6700/~dbrown "On two occasions I have been asked
[by members of Parliament], 'Pray, Mr.  Babbage, if you put into the machine
wrong figures, will the right answers come out?' I am not able rightly to
apprehend the kind of confusion of ideas that could provoke such a question."

 
 
 

problems piping from "split" to "mail" (split | mail)

Post by Werner J. Lil » Fri, 24 Nov 1995 04:00:00


Hi !

Can anybody give me a hint why the following doesnt work?


Piping from uuencode to split works flawless (checked it with "tee"), but
something doesnt work out in piping from split to mail. What happens is:
the   uuencoded file gets split up correctly (lets assume its split into
four pieces) and four mails are sent of to the correct address, but they
are empty. Instead the four files are found on disk. Any ideas?

Thanks.

Tschuess.......
              WL

 
 
 

problems piping from "split" to "mail" (split | mail)

Post by Guess Wh » Sat, 25 Nov 1995 04:00:00




: Piping from uuencode to split works flawless (checked it with "tee"), but
: something doesnt work out in piping from split to mail. What happens is:
: the   uuencoded file gets split up correctly (lets assume its split into
: four pieces) and four mails are sent of to the correct address, but they
: are empty. Instead the four files are found on disk. Any ideas?

split sends the files to disk, it doesn't send them to stdout.
  so you'll have to put it in a for loop.

uuencode <options> | split -1500
for file in x??; do

done
--
Life is a *ly transferred disease with 100% mortality.

 
 
 

problems piping from "split" to "mail" (split | mail)

Post by Craig Brent Ludingt » Sat, 25 Nov 1995 04:00:00


: Can anybody give me a hint why the following doesnt work?


From the split manpage:

       This manual page  documents  the  GNU  version  of  split.
       split  creates one or more output files (as many as neces-
                                  ^^^^^^^^^^^^

Split creates files, typically named "xaa", "xab", etc.
The standard output of split is the empty string.  
That's what got piped to mail.

Try:
        split -1500 testfile.gz # makes xaa, xab, ...
        for x in in  x??; do

                rm $x
        done

Regards,

Craig

 
 
 

problems piping from "split" to "mail" (split | mail)

Post by Bill Marc » Sat, 25 Nov 1995 04:00:00




>Hi !

>Can anybody give me a hint why the following doesnt work?


>Piping from uuencode to split works flawless (checked it with "tee"), but
>something doesnt work out in piping from split to mail. What happens is:
>the   uuencoded file gets split up correctly (lets assume its split into
>four pieces) and four mails are sent of to the correct address, but they
>are empty. Instead the four files are found on disk. Any ideas?

>Thanks.

>Tschuess.......
>              WL

The problem is that split creates files, it does not send output to
standard output.  You could do it like this:
#!/bin/ksh
uuencode $1 $1 |split -1500
for i in x??
do

  rm $i
done

--
"Goodness me, could this be industrial disease?"  Dire Straits

 
 
 

problems piping from "split" to "mail" (split | mail)

Post by Werner J. Lil » Sun, 26 Nov 1995 04:00:00



[snip!]

Quote:

> Yeah, you didn't read the man page for split:

[snip!]

> *sigh*

I rtfm'd the manpage, unfortunately it was AIX (ugh !). The split manpage
is really f*cked, it doesnt even mention that split splits files by
line... I guessed on the name and assumed it to make sense splitting a
file by lines and ,voila!, it worked.

Tschuess.....
            WL

 
 
 

problems piping from "split" to "mail" (split | mail)

Post by Dave Bro » Mon, 27 Nov 1995 04:00:00





: [snip!]
: > Yeah, you didn't read the man page for split:
: [snip!]
: > *sigh*
: I rtfm'd the manpage, unfortunately it was AIX (ugh !).

Oh, why didn't you warn me--I would've been a good deal more
understanding.  AIX manpages are just not written to be understandable
by mortals (I don't want to meet the people that WROTE them).
I would've suggested going to some machine running a better version
of Unix--say, Solaris, or IRIX--and reading THAT man page instead.

--Dave
--
http://armf18.dow.on.doe.ca:6700/~dbrown "On two occasions I have been asked
[by members of Parliament], 'Pray, Mr.  Babbage, if you put into the machine
wrong figures, will the right answers come out?' I am not able rightly to
apprehend the kind of confusion of ideas that could provoke such a question."