For example, running a command on n-number of sorted subdirectories, where n is an input. Or how can I run a for loop on a range of subdirectories where I can give that range as an input? Like the following except how can I define the range here?
for d in ["sd1"-"sd2"] do ( cd "$d" && do stuff ) done
for d in my_directory_{111..121}; do ( cd "$d" && dostuff ) done– DarkMatter Aug 23 '17 at 08:02{2..3}expands to2 3. Test withecho my_directory_{111..121}. – Kusalananda Aug 23 '17 at 08:052016-01-0{1..2}This works temporarily, but when it gets greater than 9, I cannot generalize it anymore without changing the command. Is there any suggestion there? – DarkMatter Aug 23 '17 at 08:12datecommand to generate dates – Romeo Ninov Aug 23 '17 at 08:18ksh93andbashis what I use and know. – Kusalananda Aug 23 '17 at 08:18