There is a script in bash, it runs from itself, but for some reason, then the line variable is written empty.
container="name" hostname=$(hostname) space="$(docker exec -it $container df -h | awk '{printf $1 ":" $4 "\n"}' )" arr=() while read -r line; do arr+=("${hostname}:${container}:${line}") done <<< "$space" printf "%s\n" "${arr[@]}" >> freediskspace 2>&1 cron: * / 1 * * * * root cd / opt / scripts / && / bin / bash freedisk.sh