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:
- 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.
- You can consider any number of file of a specific extension but they are all in parent and subfolders.
- Source Parent Folder and subfolders are organized like below:
- PQRST (PQRST has 4 subfolders)
- PQR (PQR has 3 subfolders)
- PQ (PQ has 2 subfolders)
- P
- Q
- QR
- RP (RP has 2 sub folders)
- R
- P
- PQ (PQ has 2 subfolders)
- QRS/QR/RS/SQ
- RST
- RS/R/S
- ST/
- S
- T
- STP/
- ST
- TP/S/T/P
- PQR (PQR has 3 subfolders)
- PQRST (PQRST has 4 subfolders)
- Destination Parent Folder and subfolders are organized as below:
- UVWXYZ (UVWXYZ has 5 sub folders)
- UVWX
- UV
- WX
- VWXY
- VWX/VW/WX/XV
- WXY
- WXYZ
- XYZ/Z
- WXY
- XYZU
- YZUV
- ZUV/ZU/U/V
- YZU/ZU/Y/U
- UVWX
- UVWXYZ (UVWXYZ has 5 sub folders)
- Conditions:
- 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.
- UV contains file *.log, *.v, *.sv, *.as, *.os, f*.vt, z*.vt, f*.v, z*.sv.
- WX contains file like *.efg, *.vpf, *.ept, *.xml, *.pdf, *.log, *.mt, *.txt.
- Folder VWXY contains file like *.area, *.density, *.cube, *.max, *.min, f*.cor, z*.cor, f*.inc, z*.inc.
- XYZ/Z contains file *.area, *.density, *.cube, *.max, *.min.
- WXY contains file f*.cor, z*.cor, f*.inc, z*.inc.
- Folder XYZU contains files like *.lib.
- Folder YZUV contains file like *.va, *.sh, *.csh, *.pl, *.py, *.gr, *.de
- ZUV/ZU/U/V contains files *.va, *.sh, *.csh, *.pl. Files can be in same folder or different folder. It is your choice.
- YZU/ZU/Y/U contains file *.py, *.gr, *.def. Files can be in same folder or different folder. It is your choice.
- Scripts should contain if needs
- Variables
- 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
