8 lines
218 B
Bash
8 lines
218 B
Bash
import-env() {
|
|
SOURCE_PROCESS=$1
|
|
SOURCE_PID=$(pgrep $SOURCE_PROCESS | head -n 1)
|
|
if [[ -z $SOURCE_PID ]]; then return 1; fi
|
|
SOURCE_ENV=("${(@ps:\000:)$(</proc/${SOURCE_PID}/environ)}")
|
|
export ${SOURCE_ENV[@]:#}
|
|
}
|