In this post I have written a script that creates an empty directory for each day of the current month. I used cal command to get the date and month instead of using date command. The reason is that the date command does not work in Solaris. To make it portable, I have used cal command.
The below script does the following
- It takes the total number of days of the current month
- It gets the current month name from the cal command
- It gets the current year from the cal command
- It creates an empty directory for each day of the current month
- Before creating, this checks whether the directory already exists, if yes, the script exits by displaying a message.
You can change the "dir" to the directory in which you want the folders to be created.

