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 already mention `cut`. You just set the delimiter to `/`. The somewhat unintuitive part is that you need fields 1-5, because the part before the first `/` is also counted as an (empty) field.

```
echo /1/2/3/4/5/6/7 | cut -d/ -f1-5

```

Result is

```
/1/2/3/4

```
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.