Hello K.,

Am 04.10.2021 um 22:11 schrieb K Crawford <kscx3ksc@xxxxxxxxx>:

Thank you for this information. I have tested it and it is working for me.
To do an initial test I change rmdir to an echo.

OK, good.

Not very fluent in this scripting. trying to figure out the change so it
only searches the current level.

Ah, only one level, you can either use

for DIR in `find . -maxdepth 1 -type d`; do
if [ `ls -1a ${DIR} |wc -l` -eq 2 ]; then
rmdir ${DIR}
fi
done

or simply

for DIR in *; do

(if the current directory level only contains no files but only directories).

There are plenty of Linux Shellscripting resources in the net. Use them. :-) Often, all that stuff works in PASE, too.

:wq! PoC


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.