Skip to content

Instantly share code, notes, and snippets.

View knjname's full-sized avatar
💭
🐙

knjname knjname

💭
🐙
View GitHub Profile
@knjname
knjname / generate-compose.sh
Created August 25, 2017 08:12 — forked from lalyos/generate-compose.sh
generate docker-compose.yml by inspecting a running container
docker-yml() {
docker inspect -f $'
{{.Name}}
image: {{.Config.Image}}
entrypoint: {{json .Config.Entrypoint}}
environment: {{range .Config.Env}}
- {{.}}{{end}}
' $1
}
#!/bin/bash
seq 0 10 | {
declare -i sum
while read num ; do
let sum+=$num
done
# bash => 55 (^^)v
# zsh => 55