Question: Write C bash automation script move_files.csh on the basis of following conditions: There are around 1000 files with extension like *.efg, *.vpf, *.ept, *.xml, *.pdf,

Write C bash automation script move_files.csh on the basis of following conditions:

  1. There are around 1000 files with extension like *.efg, *.vpf, *.ept, *.xml, *.pdf, *.log, *.v, *.sv, *.as, *.os, f*.vt, z*.vt, f*.v, z*.sv, *.lib, *.mt, *.txt, *.area, *.density, *.cube, *.max, *.min, f*.cor, z*.cor, f*.inc, z*.inc, *.va, *.sh, *.csh, *.pl, *.py, *.gr, *.def.
  2. You can consider any number of file of a specific extension but they are all in parent and subfolders.
  3. Source Parent Folder and subfolders are organized like below:
    1. PQRST (PQRST has 4 subfolders)
      1. PQR (PQR has 3 subfolders)
        1. PQ (PQ has 2 subfolders)
          1. P
          2. Q
        2. QR
        3. RP (RP has 2 sub folders)
          1. R
          2. P
      2. QRS/QR/RS/SQ
      3. RST
        1. RS/R/S
        2. ST/
          1. S
          2. T
      4. STP/
        1. ST
        2. TP/S/T/P
  4. Destination Parent Folder and subfolders are organized as below:
    1. UVWXYZ (UVWXYZ has 5 sub folders)
      1. UVWX
        1. UV
        2. WX
      2. VWXY
        1. VWX/VW/WX/XV
        2. WXY
      3. WXYZ
        1. XYZ/Z
        2. WXY
      4. XYZU
      5. YZUV
        1. ZUV/ZU/U/V
        2. YZU/ZU/Y/U
  5. Conditions:
    1. Folder UVWX will contain files like *.efg, *.vpf, *.ept, *.xml, *.pdf, *.log, *.v, *.sv, *.as, *.os, f*.vt, z*.vt, f*.v, z*.sv, *.mt, *.txt.
    2. UV contains file *.log, *.v, *.sv, *.as, *.os, f*.vt, z*.vt, f*.v, z*.sv.
    3. WX contains file like *.efg, *.vpf, *.ept, *.xml, *.pdf, *.log, *.mt, *.txt.
    4. Folder VWXY contains file like *.area, *.density, *.cube, *.max, *.min, f*.cor, z*.cor, f*.inc, z*.inc.
      1. XYZ/Z contains file *.area, *.density, *.cube, *.max, *.min.
      2. WXY contains file f*.cor, z*.cor, f*.inc, z*.inc.
    5. Folder XYZU contains files like *.lib.
    6. Folder YZUV contains file like *.va, *.sh, *.csh, *.pl, *.py, *.gr, *.de
      1. ZUV/ZU/U/V contains files *.va, *.sh, *.csh, *.pl. Files can be in same folder or different folder. It is your choice.
      2. YZU/ZU/Y/U contains file *.py, *.gr, *.def. Files can be in same folder or different folder. It is your choice.
  6. Scripts should contain if needs
    1. Variables
    2. Conditional and loops statements like if, else, elif
    3. Commands like cp, cd, mkdir, rm, mv, awk, grep, set, unset, setenv if need. Use options with these commands

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!