Article 54BDG [SOLVED] zsh: Find parent of searched file or directory and execute a command there

[SOLVED] zsh: Find parent of searched file or directory and execute a command there

by
blueray
from LinuxQuestions.org on (#54BDG)
My sub-directory has multiple .git repo. To Find them I am using:

Code:[Documents/antora]$ echo **/.git
demo-component-a/.git demo-component-b/.gitNow I actually need the parent directories. demo-component-a & demo-component-b.

I found this neat feature to find the parent of a path:

Code:$ var=/home/blueray/Documents/antora/demo-component-b
$ echo $var:h
/home/blueray/Documents/antoraNow I am trying to combine these two to run the command git commit -am "Latest Commit" in both directories.

What can be the solution here?latest?d=yIl2AUoC8zA latest?i=S7Q0h566mO4:kNFwmZdl1F4:F7zBnMy latest?i=S7Q0h566mO4:kNFwmZdl1F4:V_sGLiP latest?d=qj6IDK7rITs latest?i=S7Q0h566mO4:kNFwmZdl1F4:gIN9vFwS7Q0h566mO4
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments