Create tar archive per subdirectory

Following bash script will generate a tar archive per subdirectory found within a given directory.

Write this code in a .sh file (i.e archive.sh ). Put it in your desired root directory. Execute the .sh using ./archive.sh command.