Write a short script that tells you whether the permissions for two files, whose names are given as arguments to the script, are identical. If the permissions for the two files are identical, output the common permission field. Otherwise, out- put each filename followed by its permission field. (Hint: Try using the cut utility.)

What will be an ideal response?


The following code is the heart of this script. As always, you must specify
a shell and check the arguments.
$ cat permcomp
perm1=$(ls -l $1 | cut -d" " -f1)
perm2=$(ls -l $2 | cut -d" " -f1)
if [ $perm1 == $perm2 ]
then
echo $perm1
else
echo $perm1 $1
echo $perm2 $2
fi

Computer Science & Information Technology

You might also like to view...

One way to test a macro that you have created is to click the ____ button on the MACRO TOOLS DESIGN tab.

A. Run B. Test C. Start D. Show

Computer Science & Information Technology

Which of the following is the subnet mask for CIDR /22?

a. 255.255.255.252 b. 255.252.0.0 c. 255.255.255.254 d. 255.255.252.0

Computer Science & Information Technology

Pointers ____ be initialized when they are declared.

A. must B. must not C. can D. cannot

Computer Science & Information Technology

What Active Directory Domain Services role feature can be used to replace passwords with a two-step authentication process that combines verifying a device is enrolled in the domain and that the device has a personal identification number?

A. LDAP Identity Management B. LDAP TwoStep C. ADS TwoAuth D. Microsoft Passport

Computer Science & Information Technology