Results 1 to 4 of 4
Hi ALL,
Can u help me out in solving this problem in bash script
Write a bash script with the following characteristics:
 The script receives two paths, checks that ...
- 03-31-2010 #1Just Joined!
- Join Date
- Mar 2010
- Posts
- 2
cheak both directories
Hi ALL,
Can u help me out in solving this problem in bash script
Write a bash script with the following characteristics:
The script receives two paths, checks that they are both directories and prints errors if not.
The script Take the list of files in dir1 and check if they exist in dir2. If the files have the same size in both directories, they are considered identical, else they are considered different.
The script final output should be as follows (x, y, z are numbers):
x files from path1 are identical in path2:
path1/file_1
path1/file_2
…
Path1/file_x
y files from path1 do not exist in path2:
path1/file_1
path1/file_2
…
Path1/file_y
z files are different in path1 and path2
file_1 xxx of dir1 has size ssss and date dddd time ttttt file_1 xxx of dir2 has size ssss and date dddd time ttttt”.
…
file_z xxx of dir1 has size ssss and date dddd time ttttt file_z xxx of dir2 has size ssss and date dddd time ttttt”.
Total files in path1 are t.
Hints:
The script can use ls -l with awk to extract the needed columns.
The script can use grep, in addition to variables, loop and branch commands.
The script can store intermediary data in temporary files in /tmp/ directory
plz help me
- 03-31-2010 #2
sorry, homework questions are not allowed by the forum rules.
You must always face the curtain with a bow.
- 03-31-2010 #3Just Joined!
- Join Date
- Mar 2010
- Posts
- 2
- 03-31-2010 #4
for bash I use
Bash Guide for Beginners
and
Advanced Bash-Scripting Guide



