title: Bash copy file in user homedir MacOS
body: <p>I'm fairly new (totally new) in Shell writting. I'm using it from time to time to do specific task when my PKG tools are not enough.</p>
  
  <p>I have a folder called licences located in /Library/Application\ Support/ and I want to get it copied in the Library of the user. Luckily every user is named on a specific numeric pattern, my homedir is t25542</p>
  
  <p>So here is my small script :</p>
  
  <pre><code>#get the homedir name
  USER=`stat -f  '%Su' /Users/t*/
  
  #copy files
  ditto /Library/Application\ Support/licences/ /Users/$USER/Library/Application\ Support/licences/
  </code></pre>
  
  <p>It works, <em>but</em> I'm sure there is a more elegant way to do it since it looks pretty <em>sloppy</em>.</p>