2024-07-11 13:37:35 +03:00
|
|
|
#!/bin/sh
|
|
|
|
set -f
|
|
|
|
|
|
|
|
sed -znE '/^([^=]+)=.*$/s,,\1,p' /proc/self/environ \
|
|
|
|
| sed -zE \
|
|
|
|
-e '/^_$/d;/^ENVSUBST_/d;' \
|
2024-07-23 00:03:46 +03:00
|
|
|
-e '/^__IEP_/d;/^IEP_$/d' \
|
2024-07-11 13:37:35 +03:00
|
|
|
| {
|
|
|
|
if [ -n "${ENVSUBST_EXCLUDE_REGEX:-}" ] ; then
|
|
|
|
grep -zEv -e "${ENVSUBST_EXCLUDE_REGEX}"
|
|
|
|
else
|
|
|
|
if [ -n "${ENVSUBST_INCLUDE_REGEX:-}" ] ; then
|
|
|
|
grep -zE -e "${ENVSUBST_INCLUDE_REGEX}"
|
|
|
|
else
|
|
|
|
cat
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
} \
|
|
|
|
| sort -zV \
|
|
|
|
| xargs -0 -r printf '${%s} ' \
|
|
|
|
| sed -zE 's/ $//'
|