Question: I have two python scrips (direct.py and nat.py) and I would like to make a bash script to select which python to start based on my input.

Also, when manually running those py scripts I have input options (0...8,h and q). 
When press 'q' I have sys.exit().

eg:

```
./start.sh and output should be something like:
Chose your mode: (if type nat)
python3 nat.py

```

now python script is displayed and if press q, back to bash to chose option.

Answer: 
You might want to consider (double) "parameter expansion: Remove matching prefix/suffix pattern":

```
$ path=/home/[username]/public_html/[prjectname]/abc/xyz
$ echo "${path%"${path#/*/*/*/*/}"}"
/home/[username]/public_html/[prjectname]/

```

No external command needed.
Try this,

```
 find /path/to/dir -mindepth 4 -type d | cut -d"/" -f -5 | sort -u

```

* `type -d` will print only directories.
* `mindepth` will print the directories which have minimum 4 subdirectories.
* `-d"/"` use `/` as delimiter to cut
* `-f -5` cut the everything from the fifth column
* `sort -u` will print sorted unique folder paths.