Permission Comparision


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Permission Comparision
# 1  
Old 02-16-2012
Permission Comparision

Hi,

I need to know how to compare the permissions of files which are in two different directories in Unix..

Experts - can any one help on this..!!!
# 2  
Old 02-16-2012
This is very vague. Do the files in the different directories have all the same names?

If so, this finds differences in permissions :
Code:
ls -l /path/to/dir1 > file1
ls -l /path/to/dir2 > file2
awk ' FILENAME=="file1" {arr[$(NF)]=$1}
        FILENAME=="file2"  { print  $(NF),  (arr[$(NF)] == $1)? "matches": "no match"}

This User Gave Thanks to jim mcnamara For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

SPARCVII+ vs. T5 comparision

Hello, I need migrate our applications from M-series to T-series. I would like compare two different SPARC processors - SPARCVII+ from Fujitsu and T5 from Oracle. I found only next benchmarks: M8000: ... (9 Replies)
Discussion started by: olibertu
9 Replies

2. AIX

Binary Comparision

Hi Folks, Is there any way to compare the binaries which are built in AIX (5.3.0) environment? Thanks in advance. MKR (4 Replies)
Discussion started by: MKR
4 Replies

3. Shell Programming and Scripting

Awk comparision

Hi Everyone I am new to Unix shell scripting Can anyone please explain me in detail how this command works awk -F@ 'NR==FNR{A=$2;next}$3 in A{$3=A}1' file2 file1 The above command I got it from this forum, but unable to implement it as I am not getting how this works:mad: I... (3 Replies)
Discussion started by: Vijay90
3 Replies

4. Shell Programming and Scripting

Need help in comparision of two strings

I have two files. one files contain counts and second contain string. Now i have to compare two string . if two string are same i have to add count. If strings are same more than once i have to display final output. like this >Count.txt 1 3 12 4 5 6 1 >strings.txt AA BB BB... (1 Reply)
Discussion started by: pjlotiya
1 Replies

5. Shell Programming and Scripting

String Comparision

I want to compare two strings using awk dynamically without trimming the spaces and want to find the count of matching string. Input Strings file: File1 content (file1): " a " " a2 " File2 content (file2): " a " " a " " a2 " " b2 " " c2 "... (3 Replies)
Discussion started by: AhmedLakadkutta
3 Replies

6. Shell Programming and Scripting

File Comparision

Hi All, I want to write a script which will compare two files and tell me if the files are different. Actually my files will be same but order of lines will be different,so diff is not working. I have written a script to do this:- while read line; do cnt=`grep -i $line... (6 Replies)
Discussion started by: prasson_ibm
6 Replies

7. Shell Programming and Scripting

while - comparision

Hi, Please find the attached scriplet and suggest me to fix the bug in this. ----------------------------------- noofdirs=`ls *.tar | wc -l` if ; then let i=1 while ( $i <= $noofdirs ) ; do echo $i mkdir $i file1=`ls *.tar | head -1` mv $file1 $i i =... (2 Replies)
Discussion started by: sharif
2 Replies

8. Shell Programming and Scripting

alphanumeric comparision

I have a requirement where I need to check if where r1v07l09ab is a software release. I should always check for this to be true to continue the release deployment because an older release should not be deployed by mistake. I mean only the release greater than the current release should be... (3 Replies)
Discussion started by: rakeshou
3 Replies

9. UNIX for Dummies Questions & Answers

date comparision

Hello, I am trying to compare two dates which are in variables and i am not getting the correct result as expected. $first_date = '07/19/2007' $second_date='07/20/2007' Can you please suggest how to i check whether they are equal or not. if ($first_date -eq $second_date) condition is not... (3 Replies)
Discussion started by: kotasateesh
3 Replies

10. SuSE

SuSE comparision

A friend has a drawerful of demo CDs and such. I found some SUSE CDs: 1. Novell Linux Desktop 9 2. SUSE Linux Enterprise Server 9 What's the difference between the two? ...and is Enterprise Server 9 the same as the SuSE Pro version? Should I use one of these CDs to install linux or... (8 Replies)
Discussion started by: lungs
8 Replies
Login or Register to Ask a Question