4/27 "cat * > foo" in a directory containing < 50k produces a >10M file
that exceeds my quota. Whatup?
\_ maybe it's hitting ".." too
\_ does your directory include a file called foo perchance?
\_ No. redirecting to "bar" returns the same error.
\_ Hint: * includes foo. --oj
\_ No it does not. if foo exists, the shell complains if i try to
write to foo. I'm trying to cat a bunch of numbered files (ie
named 1, 2, 3,...) into a file of any given name.
\_ Yes it does. Try "ls * > foo" and you'll see foo being listed
inside itself. -- yuen
\_ The shell creates "foo" with zero size before expanding '*'
\_ depends on your shell. ksh under solaris, for example,
\_ Depends on your shell. ksh under solaris, for example,
does the expansion FIRST. But then, ksh is generally
more intelligent than csh anyway.
\_ you're creating an interesting feedback loop/race condition. If
\_ foo
you did it in a dir where foo was the first file listed by *
then you might get nothing interesting. If theres enough in
files listed before foo to fill your write cache, it goes
into a loop of writing foo onto itself. Until somethin like
an over-quota error stops it. This kind of thing is useful
if you want to, for example, write a big file to a disk until
it is completely full. -ERic
\_ Aah, this makes sense. I've done stuff like this before with no
probs, but it was the number files screwing things up.
Incidentally, `cat * > .foo` and cat * > %foo` worked fine.
Thanks.
\_ dd if=/dev/zero of=largefile |