On Sun, Jan 30, 2000 at 07:39:57PM +1100, Ken Yap wrote:
| >As an extension to the shell programming talk at last night's meeting:
| >
| >user@somebox$ for i in `seq -w 1 2147483648`; do touch file$i; done
| >
| >should quickly fill up your inodes :)
| 
| Bet you haven't actually tried it because you'll probably hit the limit
| on the number of arguments first.

Hmm. Maybe, but only because you're out of RAM; no exec() limit is involved
because the args are being given to the for loop, a shell internal.

| Better use expr in a loop to increment
| a variable.  Or better still, write it in C or Perl, shell will take ages.

Rubbish. Using "touch" will take ages (fork/exec cost), but

        seq -w 1 2147483648 \
        | while read seq
          do  >"$seq"
          done

will scream.

The shell is your friend, learn to use it efficiently.
-- 
Cameron Simpson, DoD#743        [EMAIL PROTECTED]    http://www.zip.com.au/~cs/

SCCS, the source motel!  Programs check in and never check out! - Ken Thompson
--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text

Reply via email to