Structural programming in bash

Tasks

Task 1. Create the following structure of files and directories in /dev/shm using the for loop and brace expansion. you should create all 1000 files, not 30 like below.

.
├── 2000s
│   ├── 2000s
│   │   ├── 2000.txt
│   │   ├── 2001.txt
│   │   ├── 2002.txt
│   │   ├── 2003.txt
│   │   ├── 2004.txt
│   │   ├── 2005.txt
│   │   ├── 2006.txt
│   │   ├── 2007.txt
│   │   ├── 2008.txt
│   │   └── 2009.txt
│   ├── 2010s
│   │   ├── 2010.txt
│   │   ├── 2011.txt
│   │   ├── 2012.txt
│   │   ├── 2013.txt
│   │   ├── 2014.txt
│   │   ├── 2015.txt
│   │   ├── 2016.txt
│   │   ├── 2017.txt
│   │   ├── 2018.txt
│   │   └── 2019.txt
│   ├── 2020s
│   │   ├── 2020.txt
│   │   ├── 2021.txt
│   │   ├── 2022.txt
│   │   ├── 2023.txt
│   │   ├── 2024.txt
│   │   ├── 2025.txt
│   │   ├── 2026.txt
│   │   ├── 2027.txt
│   │   ├── 2028.txt
│   │   └── 2029.txt
│   ├── 2030s
│   ├── 2040s
│   ├── 2050s
│   ├── 2060s
│   ├── 2070s
│   ├── 2080s
│   └── 2090s
├── 2100s
├── 2200s
├── 2300s
├── 2400s
├── 2500s
├── 2600s
├── 2700s
├── 2800s
└── 2900s

Task 2. Assume that we have the following files:

Write a command (loop) that renames all the *.srt files so that the differ only by the extension from the corresponding *.mkv files.

Task 3. Write a loop that runs each line from a given file as a command. Omit lines starting with a # (comments).