Recursive loop for maxdepth=1 does not work
Good Morning/Afternoon/Evening All,
I am in a parent directory and I have repositories like below. It is a very rapid development environment and I want to automate git pull so no matter if I am working or not on any repo, every day I should do a git pull before I start with my work. Directories are as below: + ls --color=auto Code:
AGL-IAC GO5-IAC ST8-IAC learn-terraform-locals terraform-azurerm-application-gateway terraform-azurerm-security-groups My hacky shell script is like below: Code:
for dir in *; do [ -d "$dir" ] && cd "$dir" && git remote -v && git pull & cd ..; done; |
An & is missing:
Code:
for dir in *; do [ -d "$dir" ] && cd "$dir" && git remote -v && git pull && cd ..; done; Code:
for dir in *; do [ -d "$dir" ] && git -C "$dir" remote -v && git -C "$dir" pull; done; |
Thank you and Beautiful!!
|
All times are GMT -5. The time now is 05:38 PM. |