runit-user-services/import-env.zsh
2023-08-20 17:21:42 +02:00

7 lines
174 B
Bash

import-env() {
SOURCE_PROCESS=$1
SOURCE_PID=$(pgrep $SOURCE_PROCESS | head -n 1)
SOURCE_ENV=("${(@ps:\000:)$(</proc/${SOURCE_PID}/environ)}")
export ${SOURCE_ENV[@]:#}
}