Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Nov 2000 00:20:55 +1100
From:      Zero Sum <count@shalimar.net.au>
To:        Sebastiaan van Erk <sebster@sebster.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: argument list too long
Message-ID:  <00111700205500.61931@shalimar.net.au>
In-Reply-To: <20001116122313.A69018@sebster.com>
References:  <20001116091607.A97857@sebster.com> <00111621362707.00522@shalimar.net.au> <20001116122313.A69018@sebster.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----

On Thursday 16 November 2000 22:23, Sebastiaan van Erk wrote:
> Zero Sum wrote:
>
> > Man 'xargs'.
>
> I know what xargs does. Do you want me to use xargs to run tar many times,
> appending some files each time? That's a pretty lousy solution if you ask
> me.
>
No, that was not what I was suggesting.  But you are describing a common
problem - not just with tar, so I gave a general solution so that it
covered similar problems.  I then went on to cover your problem specificaly.


> > FWTW, the size of the command line buffer is a charatristic of the shell
> > you use not the operating system.  Don't be so quick to attack or you
make
> > a fool of yourself.
>
> eeyore(ttype:9:0):/usr/src/usr.bin> strings /usr/bin/tar | grep "Argument"
> Argument list too long
>
> Oh really, then why is that string part of the tar binary. Why does it
come
> from /usr/src/lib/libc/gen/errlst.c? Why does it seem to be part of libc?
> And why DIDN'T Linux have any problems (tried using both tcsh and bash
> on both Linux and FreeBSD).
>
No, you miss my point.  A construction like

# program `find....`

is going to encounter problems sooner or later because the shell performs
the expansion not the program.  Irrespective of how many parameters the
program takes you are going to run out of command line space with any
significant amount of filenames.  It is simply a construction to be avoided
in the same way that one avoids buffer overruns.  For the same reason.  It
breaks.


> I didn't attack any OS (other than perhaps DOS), I just stated my opinion
> that I don't like having limits on argument lists.
>
> > Oh, and...  The way to use tar and find is...
> >
> > find . -name "*.jsp" -depth | tar -czvf jsp.tgz
> >
> > Which won't tell you that your argument list is too long.
>
> You're right. It didn't. It also made an EMPTY tar file (except for a

Because I stupidly left off the new GNU options --files-from - (use all the
dashes) from the end.  Sorry once upon a time it used to be the default.
I don't look at man pages as often as I should anymore either.

> header). I don't see anywhere in the tar manpage that you use it in this
> way to get a file name list from stdin (and it doesn't work for me).
> In fact, I read the man page several times because I couldn't figure
> out how to do just that. And I still don't know.
>
Look, I was over the top because i've spent most of my day listening to
FreeBSD vs RedHat arguments, when the question was already settled, just
recriminations and swipes.  So I over reacted severly, and I sincerely
apologise.  Please just forgive me for this.

That, said, this is what I mean by a fundamental understanding of the Unix
system.  You missed (1) that the construction you were using was non-viable
anyway.  Any significant number of files would break the system, so it
didn't matter which broke first, (2) that - is the symbol for stzndard in
to a program where a filename is required. I'm sure you saw the
--files-from option in the manpage.

Even missing that (the - ), then

find . -name "*.jsp" -depth > tmp1
tar -cvxf jsp.tgz --files-from tmp1
rm tmp1

should have been easy to see.

> Thanks for the -depth option. That worked, even though it's not directly
> obvious from the man page (yes, I did read it) that this is the way to do
it.
>
> > So if you had used find and tar correctly you would not have had a
problem
> > which led to you making an inappropriate and irrelevant slur on an
> > operating system of which you demonstrate a lack of fundamental
> > understanding.
>
> Well, using your fundamental understanding didn't help me much either.
>
You have a point.  I went off half cocked and did not explain as well as I
should have.  I trust I have explained more clearly now?

> > I would heartily recommend looking reading Unix manual until you know
what
> > it's genral features are and how it works.
> >
> > Sorry, I've had a bad day.
>
> So you try to make yourself feel better by trying to spoil other people's
> day? By insulting people who have legitimate questions? And by blurting
> a lot of incorrect information?
>
Not quite, as I did, or at least attempt to answer your legitimate
questions and the information was not incorrect, but incomplete.  I still
think that you made a 'snipe', but you are right, I should have ignored it.
>
> This mailing list is so people can HELP eachother. If you don't know how
> to help people or can't do it in a friendly way, then do us all a favor
> and don't answer email on this mailing list.
>
And help you I have, have I not?  You have the exact answer you require to
your problem, in fact two answers, spelled out.  You have picked up several
other items that you had not seen or did not know.  I think that you have
received good value, I'm sorry if you don't.

As for being an ascerbic a***h**e about it, I regret that, and apologise
for it.  I can only say that if you had had the day I had, even a saint
might have slipped.

regretfully,

Geoff
--
count@shalimar.net.au
Nihil curo de ista tua stulta superstitione


-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
MessageID: 1TZQX2uZjdJJDZJsmAI3OU/pU7Jifzne

iQA/AwUBOhPfRfh4xz7LU/evEQIikQCfS2UGg/Mcl3nSymU7i5nYnHk923gAoOvE
+CAzLDVwaZRSXSYY+fEBsTdV
=QhRJ
-----END PGP SIGNATURE-----


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00111700205500.61931>