From ecbb253bcc0c730d217f2717e5d7196908a6c166 Mon Sep 17 00:00:00 2001 From: B1t0n <50264063+B1t0n@users.noreply.github.com> Date: Tue, 9 Nov 2021 20:39:38 +0800 Subject: [PATCH] Modified variables ignore list names When using -v , in some case where PS scripts uses Out-File and a $file variable was defined, it overwrites the "-File" part of the cmdlet, creating unknwon command Out-DFsdv34sdfvd. I just added few more problematic variables. --- chimera.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chimera.sh b/chimera.sh index 3c79aff..5c83ec8 100755 --- a/chimera.sh +++ b/chimera.sh @@ -559,7 +559,7 @@ function replace_variables () { create_rand; fi; # don't modify built-in and other problematic variables - ignore='\$_\|$true\|$false\|$read\|$verb\|$error\|$null\|$arg\|>\|&\|+\|@\|\/\|-\|\$$'; + ignore='\$_\|$Credential\|$Byte\|$Hash\|$Csv\|$Clixml\|$Object\|$item\|$Process\|$Instance\|$version\|$File\|$Name\|$Path\|$env\|$true\|$false\|$read\|$verb\|$error\|$null\|$arg\|>\|&\|+\|@\|\/\|-\|\$$'; if grep --color=always --color=no -qi "$ignore" <<< "$var"; then if [[ ! -f "$dictionary" ]]; then rand="$(printf %"${lvl[2]}"s\\n)";