Write a bash script to find all the files ending with .c recursively for every directory...

80.2K

Verified Solution

Question

Programming

Write a bash script to find all the files ending with .crecursively for every directory in your current working directory,then copy each one to a folder called programs, need handleduplicates by appending the number to the end of the file (exmain.c main-1.c ) compile them and generate a report

report should look like:

main.c compiles

prog2.c failed

main-2.c compiles

etc.

Answer & Explanation Solved by verified expert
4.2 Ratings (503 Votes)
binbash DefiningCreating Program Directory Programsprograms if d Programs then mkdir Programs fi for srcpath in find type f if it is reading from this program directory then dont process it do srcdirnamedirname srcpath if srcdirname Programs    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students