From b283f3af97d20efc7f663d792bd18f20fd70aae0 Mon Sep 17 00:00:00 2001 From: Roman Beranek Date: Wed, 14 Jul 2021 03:31:12 +0200 Subject: [PATCH] clear out positional parameters prior to eval Shift the first positional parameter out into a variable before running the eval command, so that it is not passed onto sourced scripts. --- functions/__bass.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/__bass.py b/functions/__bass.py index 3fe17fc..8c7841e 100644 --- a/functions/__bass.py +++ b/functions/__bass.py @@ -59,7 +59,7 @@ def gen_script(): pipe_r, pipe_w = os.pipe() if sys.version_info >= (3, 4): os.set_inheritable(pipe_w, True) - command = 'eval $1 && ({}; alias) >&{}'.format( + command = 'bass_args=$1; shift; eval $bass_args && ({}; alias) >&{}'.format( env_reader, pipe_w )