Add import-env to repo
This commit is contained in:
parent
283d26d831
commit
2de8087c3e
3 changed files with 8 additions and 2 deletions
6
import-env.zsh
Normal file
6
import-env.zsh
Normal file
|
@ -0,0 +1,6 @@
|
|||
import-env() {
|
||||
SOURCE_PROCESS=$1
|
||||
SOURCE_PID=$(pgrep $SOURCE_PROCESS | head -n 1)
|
||||
SOURCE_ENV=("${(@ps:\000:)$(</proc/${SOURCE_PID}/environ)}")
|
||||
export ${SOURCE_ENV[@]:#}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue