bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17384: "bug" in the Unix "cat" command


From: Peter Rowat
Subject: bug#17384: "bug" in the Unix "cat" command
Date: Thu, 1 May 2014 11:50:38 -0700

Hello Gnu folks,

  I had 3 files  matching “isi.*.02p0:

wc -l isi.*.02p0
   20000 isi.R.0400.02p0
   15500 isi.Ra.0400.02p0
   15600 isi.Rb.0400.02p0
   51100 total

I wanted to combine them into one big file, while knowing *not* to cat into a 
file with same name as an original file,
 I did this:

cat isi.*.02p0 >isi.Rall.0400.02p0


But it never returned!! 
By the time I hit Ctrl-C, the file isi.Rall.0400.02p0 was already 3000 times 
bigger than the biggest of the original files.

A hidden loop was made. 

Because the destination file was created before concatenation started, it 
became a match for the
pattern "isi.*.02p0”.

It might be worth adding a warning about this on the  cat man-page ??

Cheers,

— Peter Rowat

reply via email to

[Prev in Thread] Current Thread [Next in Thread]