1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
samba-mirror/selftest/save.env.sh
Stefan Metzmacher 3076b1ed44 selftest: add save.env.sh helper script.
This can be used to store the environment from within
make testenv.

It can be restored with:

. bin/restore.env.source

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-06-27 05:00:15 +02:00

16 lines
311 B
Bash
Executable File

#!/bin/sh
{
vars=`set | \
grep "^[a-zA-Z][^=]*='[^']*'$" | \
grep -v '^IFS=' | \
grep -v '^TERM' | \
grep -v '^PPID' | \
grep -v '^PS[1-9]=' | \
cat `
echo "${vars}"
echo "${vars}" | sed -e 's!^\([a-zA-Z][^=]*\)=.*$!export \1!'
} > bin/restore.env.source
echo "RUN: '. bin/restore.env.source'"