Returns a String free of any unsafe command injections in your Bash shell script. Wraps the input String with single quotes and escapes any existing single quotes so that you can pass the String directly to a shell function as a safe argument.
The string
The sanitized string or array of strings.
sanitizeBashShellArguments('echo "Hello, World!"'); // → 'echo "Hello, World!"' Copy
sanitizeBashShellArguments('echo "Hello, World!"'); // → 'echo "Hello, World!"'
If input data type is not String, the data is not transformed at runtime.
Returns a String free of any unsafe command injections in your Bash shell script. Wraps the input String with single quotes and escapes any existing single quotes so that you can pass the String directly to a shell function as a safe argument.