Hi all,

I need to create thousands of directories in a single parent directory using shell scripting code. One problem would be to generate the unique directory name for each of the 1000 iterations to create a directory every time. ie first time the directory name needs to be subdir1 and then subdir2 for the next iteration and so on.
Could anyone please help me with the script?

Thanking you,
Prashanth

'seq' may not work in all environments.
Here is the code.

!#/bin/bash
for((j=1;j<=1000;j++));do
mkdir subdir_$j 2> /dev/null
done

to delete again:

!#/bin/bash
for((j=1;j<=1000;j++));do
rmdir subdir_$j  2> /dev/null
done

Let me know in case of any problem with he script in any
environments like:

UNIX (SUN SOLARIS)
LINUX
UBUNTU and all flavours.

This question has already been answered. Start a new discussion instead.