From: *@eli.users.panix.com   
      
   In alt.os.linux.slackware, Mike Small wrote:   
   > I've noticed slackbuilds tend to copy files in place using cat unless   
   > they do multiple files in one command, in which case they of course must   
   > use cp. Anyone know the thinking behind or origin of that?   
   >   
   > I see a couple web hits with possibilities but nothing definitive...   
   >   
   > https://unix.stackexchange.com/questions/30295/cp-vs-cat-to-copy-a-file   
      
   My speculation is on the permissions issues mentioned in a reply there.   
   cp will copy permissions (to a certain extent), cat > newfile will   
   create new permissions based on umask.   
      
   # touch /tmp/installme   
   # chmod 7661 /tmp/installme   
   # cat /tmp/installme > /tmp/installme-cat   
   # cp /tmp/installme /tmp/installme-cp   
   # ls -l /tmp/installme*   
   -rwSrwS--t 1 root root 0 Oct 30 13:13 /tmp/installme   
   -rw-r--r-- 1 root root 0 Oct 30 13:13 /tmp/installme-cat   
   -rw-r----x 1 root root 0 Oct 30 13:13 /tmp/installme-cp   
   #   
      
   But any proper install will be setting permissions as a followup step   
   anyway, right?   
      
   Elijah   
   ------   
   the sparse file thing is plausible, too   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|