Skip to content

Instantly share code, notes, and snippets.

@5a494d
Created August 20, 2019 02:53
Show Gist options
  • Save 5a494d/613ec74f35737759b8c289db9b6eb60d to your computer and use it in GitHub Desktop.
Save 5a494d/613ec74f35737759b8c289db9b6eb60d to your computer and use it in GitHub Desktop.
docker.container.iterator.sh
#!/bin/bash
list=$(docker ps)
IFS=$'\n' array=($list)
for index in "${!array[@]}"
do
declare -a a=("${array[index]}")
printf "%s\n" "${a[@]}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment