shell - checking if owner/group match in files and subfolders -


I need help writing a script, to see if the owner and group in my IF statement Matches or not.

For example, my directory structure might look like this

  / data / data / folder1 / data I need to verify that the data, folder 1, Folder 2, File A, FileB is all owned by the same owner and group.       ex>  #! / Bin / bash DIR = "/ data"; N = 0; For $ dir .. if [not match "username: group name"]; Then N = 1; If [$ N -gt 0]; Then "all or some files and folders do not match"; The second "resonate with all the files"; Fi    

  #! / Bin / bash OWNER = user ACTUAL_OWNER = 'stat -c% U file' n = 0; Not_match (files) {if [! OWNER = ACTUAL_OWNER]; Then N = 1; Return; And if [not_end_of_file]; Then not_match (files + 1) and return)} DIOR = "/ data"; not_match (files) if [$ N -gt 0]; Then "all or some files and folders do not match"; The second "resonate with all the files"; Fi   

I was not sure about certain commands or syntax, so it has some pseudo code but basically this is what you want to do if they are a match and you If the files to be searched is not the end, call the function again and increase the next file if it does not match, do not say or refund, because you do not tell the user how many matches And if the end then gets success and the user returns to print

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -