diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-06-07 17:48:09 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-06-07 17:48:09 +0800 |
| commit | 470a9106d391424c43a5640a646f37b1e5d28fcd (patch) | |
| tree | 0e8ff63cff46f95224812755058496ae1bec12ac /escapeEnv.py | |
| parent | f798244d6c3a3f0a686622435f1c1ce9353bcf93 (diff) | |
bump
Diffstat (limited to 'escapeEnv.py')
| -rw-r--r-- | escapeEnv.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/escapeEnv.py b/escapeEnv.py new file mode 100644 index 0000000..9ff4f84 --- /dev/null +++ b/escapeEnv.py @@ -0,0 +1,23 @@ +from sys import argv + +def main(): + if len(argv) < 2: + print("Usage: python escapeEnv.py <string>") + return + + input = argv[1].split() + for i in range(len(input)): + first = True + pos = -1 + for j in range(len(input[i])): + if input[i][j] == "=" and pos == -1: + pos = j + input[i] = input[i][:j+1] + '"' + input[i][j+1:] + '"' + + pos = -1 + + print(' '.join(input)) + + +if __name__ == "__main__": + main() |
