Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • You are asking several questions, which are technically unrelated (related only by the fact that you happen to need the answer for the same program): How to ask the user for input, how to write a loop based on a certain condition, and how to exclude a file name from a path (3 questions). In this case you should create three threads in this forum, one for each question. Also, I can't help wondering to what extend you were reading the bash man-page before asking this. Also, for the question of reading user input, you can use this well known website. Commented Sep 11, 2017 at 6:50
  • For the mkdir part, see if dirname is what you are looking for: dirname path/to/entry.a.b.c returns path/to. Commented Sep 11, 2017 at 9:03