At the very simplest, to satisfy your requirement to "loop through each directory in the one that i am currently in", just use a wildcard
for d in */
do
dummy_command "$d"
done
If your command can't cope with the trailing slash that's part of $d
, you can remove it by replacing "$d"
with "${d%/}"
.
If your command can take multiple arguments you don't need a loop at all
dummy_command */
An example of dummy_command
for testing might be simply echo
.
Notice that in all cases, if there is no match to the */
pattern, it will get passed through as a literal asterisk and slash to your command. This is almost certainly not what you want.
For bash
you can fix it by adding this line above your loop, but be aware it will apply from that point on
shopt -s nullglob # Expand unmatched wildcards to "nothing"
...until you have a corresponding shopt -u nullglob
or your script ends