Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribedimage text in transcribed

z* a. 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, *as, *.os, f*.vt, z*.vt, f*.v, z*.sv, *.lib, *.mt, *.txt, *.area, * density, *.cube, *.max, *.min, f*.cor, *.cor, f*.inc, z*.inc, *va, 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: a. PQRST (PQRST has 4 subfolders) i. POR (PQR has 3 subfolders) 1. PQ (PQ has 2 subfolders) P b. Q 2. QR 3. (RP has 2 sub folders) R b.pl ii. QRS/QR/RS/SQ iii. RST 1. RS/R/S 2. ST/ S b. T iv. STP/ 1. ST 2. TP/S/T/P RP a. a. 4. Destination Parent Folder and subfolders are organized as below: a. UVWXYZ (UVWXYZ has 5 sub folders) i. Uvwx 1. UV 2. WX ii. VWXY 1. VwX/VW/WX/XV 2. WXY iii. WXYZ 1. XYZ/Z 2. WXY iv. XYZU V. YZUV 1. ZUV/ZU/U/V 2. YZU/ZU/Y/U 5. Conditions: a. Folder UVWX will contain files like * efg, *vpf, .ept, *.xml, *.pdf, *.log, os, f*.vt, z*.vt, f*.v, z*.sv, *.mt, *.txt. b. UV contains file *.log, f*.vt, z*.vt, f*.v, z*.sv, WX contains file like * efg, * vrf, *ept, *.xml, *.pdf, *.log, *.mt, *.txt. d. Folder VWXY contains file like *.area, * density, *.cube, *.max, *.min, f*.cor, f*.inc, z*.inc. i. XYZ/Z contains file * area, * density, * cube, *.max, *.min. * .as, * SV w .as, os, W * c. z*.cor ii. WXY contains file f*.cor, z*.cor, f*.inc, z*.inc. e. Folder XYZU contains files like *.lib. f. Folder YZUV contains file like *.va, .csh, *.pl, *.py, *.gr, *.def. i. ZUV/ZU/U/V contains files csh, *.pl. Files can be in same folder or different folder. It is your choice. ii. YZU/ZU/Y/U contains file * px, *gr, * def. Files can be in same folder or different folder. It is your choice. 6. Scripts should contain if needs a. Variables b. Conditional and loops statements like if, else, elif Commands like cp, cd, mkdir, rm, mv, awk, grep, set, unset, setenv if need. Use options with these commands c

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions