Skip to content
Advertisement

Tag: os.system

Python ‘source HOME/.bashrc’ with os.system()

I am writing a python script (Linux) that is adding some shell aliases (writes them to HOME/.bash_aliases). In order to make an alias available immediately after it was written I should issue the following bash built-in: source is a bash built-in so I cannot just: If i try something like: …will freeze the script (just like is waiting for something).

Advertisement