I'm looking for a command or bash script that will create an index.html file in every directory and subdirectory starting at the current directory. I would like it to prompt to overwrite so I don't delete a good index.html file.
diocode 0 Newbie Poster
Recommended Answers
Jump to PostThis doesn't prompt to overwrite; it does nothing in directories already containing index.html:
ndx=index.html find . -type d | while read dir do ( cd "$dir" && [ -s "$ndx" ] || mkindex > "$ndx" ## where mkindex is a script to create index file ) done
All 2 Replies
Reply to this topic Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.