Stupid kernel question

William F. Acker WB2FLW +1-303-777-8123 wacker at octothorp.org
Tue Aug 29 22:51:52 EDT 2000


Actually, when you use the greater-than symbol and a filename, the shell 
just creates the file if it doesn't exist and send standard output to
it.  If the file exists, the permissions of the *target* file are kept
as they were regardless of the current umask, as you said.  when the
shell creates the new file, it has no way to preserve the permissions of 
the source file because it has no idea where the cat command is getting
its input.  So the permissions of the target are derived from the
current umask of the invoking process.  If you want to preserve the
permissions of the original, use the -p flag of cp.



          HTH.
         Bill in Denver
On Wed, 30 Aug 2000,
Kerry Hoath wrote:

> They probably use cat because you can use that to put the kernel ona file;
> a block device etc. Also catting a file >another file preserves the
> permitions of the original whereas cp doesn't usually. It also means that
> if you cat >another file and the file exists; your umask won't come into play.
> Those are my ideas on the issue but nothing wrong with cp.
> On Tue, Aug 29, 2000 at 04:13:25PM -0400, Kirk Reiser wrote:
> > No reason I can think of.  I use cp all the time and would recommend
> > it. Maybe they don't know there's a copy command under linux!? 'grin'
> > 
> >   Kirk
> > 
> > -- 
> > 
> > Kirk Reiser				The Computer Braille Facility
> > e-mail: kirk at braille.uwo.ca		University of Western Ontario
> > phone: (519) 661-3061
> > 
> > _______________________________________________
> > Speakup mailing list
> > Speakup at braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> > 
> 
> 





More information about the Speakup mailing list