title: how to check if a particular user is a owner of certain directories and if not then assign this user as a owner using bash script
body: <p>I am new in linux and currently have to perform a task where I have to check if a particular user is an owner of a directory and its subdirectory and if not then assign him as a owner. I need to do this in a bash script so anyone if can provide me a sample would be really great.</p>
  
  <p><strong>Scenario:</strong>
  path = "/opt/dev/myapp"</p>
  
  <p>this directory contains more subdirectories and the files</p>
  
  <p>Need to check if the user "devuser" is an owner or not and if not then assign him as an owner.</p>
  
  <p>Thanks in Advance!</p>