Method 2 (recommended): Write a shell script and wrap the command
This method writes a shell script and wraps the command that was run in it. This method is safer and does not open /bin/shell in the allowlist.
As an example of wildcards:
- Write a custom_grep.sh script. For
example:
user_arg=$1 grep $user_arg
- Add custom_grep.sh to the allowlist and restart the Host Server.
- In the Remote Commands tool, run this
command:
/home/user/custom_grep.sh exec /opt/cloverleaf/cis20.1/*/tclprocs/*.tcl
As a pipes example, write a piping.sh:
user_arg1=$1 user_arg2=$2 /bin/bash -c "$1 | $2"
- Add it to the allowlist.
- Restart the Host Server
- Run it in Remote
Commands:
/opt/cis20.1/integrator/usercmds/piping.sh "ls -l $HCIROOT" "grep hello"