KatherineF
Technical User
Hi,
I have a bash script as follows:
-------------------------------------------
#!/bin/sh
for dir in `find /foo/stats/* -type d`
do
mkdir `find $dir/newfolder/`
Done
-------------------------------------------
However, there`s a detail that I`d be grateful for help with:
As is, the script creates "newfolder" subfolder for ALL LEVELS of subfolders under "/foo/stats".
However, I`d like to apply it to the FIRST LEVEL OF SUBFOLDERS ONLY, e.g. "foo/stats/folder1", "foo/stats/folder2" BUT NOT TO "foo/stats/folder1/subfolder/", "foo/stats/folder2/subfolder/" and so forth.
Could you please help me modify this script appropriately?
Thanks in advance
I have a bash script as follows:
-------------------------------------------
#!/bin/sh
for dir in `find /foo/stats/* -type d`
do
mkdir `find $dir/newfolder/`
Done
-------------------------------------------
However, there`s a detail that I`d be grateful for help with:
As is, the script creates "newfolder" subfolder for ALL LEVELS of subfolders under "/foo/stats".
However, I`d like to apply it to the FIRST LEVEL OF SUBFOLDERS ONLY, e.g. "foo/stats/folder1", "foo/stats/folder2" BUT NOT TO "foo/stats/folder1/subfolder/", "foo/stats/folder2/subfolder/" and so forth.
Could you please help me modify this script appropriately?
Thanks in advance