Substitute environment variables in a string
Project Links
Meta
Author: Alex Shafer
Classifiers
Substitute environment variables in a string:
>>> import os
>>> from envsubst import envsubst
>>> del os.environ['PS1']
>>> print(envsubst('$USER@$HOST ${PS1:-$}:'))
ashafer01@github.com $:
>>> os.environ['PS1'] = ''
>>> print(envsubst('$USER@$HOST ${PS1:-$}:'))
ashafer01@github.com $:
>>> print(envsubst('$USER@$HOST ${PS1-foo}:'))
ashafer01@github.com :
>>> os.environ['DEFAULT_PROMPT'] = '$'
>>> print(envsubst('$USER@$HOST ${PS1:-$DEFAULT_PROMPT}:'))
Also supports $0, $1, etc. from argv.
0.1.5
Oct 05, 2019
0.1.4
May 31, 2019
0.1.3
May 31, 2019
0.1.2
May 31, 2019
0.1.1
May 25, 2019
0.1.0
May 25, 2019
Wheel compatibility matrix
Files in release
No dependencies