Find the answer to your Linux question:
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 ...
  1. #1
    Just 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

  2. #2
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,102
    sorry, homework questions are not allowed by the forum rules.
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Mar 2010
    Posts
    2
    Quote Originally Posted by Irithori View Post
    sorry, homework questions are not allowed by the forum rules.
    i am sorry ,

    can you help me , what do of this proplem ?

    How should the solution of the question ..

    Please, give me the beginning of the program

    i need write this program

  4. #4
    Linux User ptkobe's Avatar
    Join Date
    Feb 2008
    Location
    Torres Vedras, PT
    Posts
    274

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...