Last active
March 4, 2024 09:02
-
-
Save michael-sumner/b96f855cf6b7a8f601829a4516c6dd48 to your computer and use it in GitHub Desktop.
Pantheon terminus - How to Loop in Subshell Commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example: loop through all post ids and update the post meta for each post_id to assign the post_date | |
for post_id in $(terminus remote:wp examplesite.environment -- post list --format=ids); do terminus remote:wp examplesite.environment -- post meta update "$post_id" examplemeta_start_date "$(terminus remote:wp examplesite.environment -- post get $post_id --field=post_date)"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment