home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.linux.slackware      I think its the one without Selinux crap      87,272 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 86,808 of 87,272   
   Eli the Bearded to smallm@panix.com   
   Re: cat vs. cp in slackbuilds   
   30 Oct 24 20:16:20   
   
   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)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca