Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ucsfcgl.UUCP Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!ucsfcgl!arnold From: arnold@ucsfcgl.UUCP (Ken Arnold%CGL) Newsgroups: net.unix-wizards Subject: Re: Unix already has "attributes"... Message-ID: <622@ucsfcgl.UUCP> Date: Fri, 23-Aug-85 01:58:23 EDT Article-I.D.: ucsfcgl.622 Posted: Fri Aug 23 01:58:23 1985 Date-Received: Sat, 24-Aug-85 19:59:16 EDT References: <3398@decwrl.UUCP> <2000018@ccvaxa> <1314@eagle.UUCP> <2636@sun.uucp> Reply-To: arnold@ucsfcgl.UUCP (Ken Arnold) Organization: UCSF Computer Graphics Lab Lines: 24 In article <2636@sun.uucp> gnu@sun.uucp (John Gilmore) writes: >Why do you have to copy >executables with "cp" rather than "cat" or "dd"? They won't execute if >you cat them...because the file permissions are specifically propagated >by code in "cp", but not by "cat". To copy files with cp you say "cp file1 file2". To copy files with cat you say "cat file1 > file2". If you look carefully, you will note that cat does not copy files. That is not its function. The ">" part of the command is executed by the shell, which is simply putting the output of whatever command is to the left of the ">" into the file named on the right. It doesn't know that you're trying to do a copy. What permissions should be set "make.out" given make >& make.out ? Does it need execute permissions? You're asking for dwim, here. "cp" is to copy files. "cat" is to concatentate them and print them. That there are many ways to do almost anything in UNIX, but this does not relieve you of the responsibility of using wrong ones. "dd", of course, does claim to copy files, but it was really designed for moving files to and from devices, not just copying one file to another, so you might look somewhat kindly on the people who left it out. Ken Arnold