I'm trying to write a simple ruby script that will copy a file to the immediate subdirectories of a directory. How would I get only the immediate subdirectories?
Assuming you only wanted the immediate subdirectories, you could use Dir['*/']
(which combines Micheal Sepcot's and glenra's answers).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With