Terminal legacy mode

Add custom commands to Rebex Buru Server SSH subsystem.

Custom shell commands can be enabled in the [config.yaml]https://www.rebex.net/doc/buru-sftp-server/configuration/config/sshshell/). Commands can be found in aliases file.

Windows impersonation disables custom shell commands for the user as impersonation is not supported for custom shell commands yet.

Syntax

# comment
mycommand1=path_to_exe arg1 arg2 arg3 ...
mycommand2=path_to_exe arg1 arg2 arg3 ...
...

Special parameters

  • $0- denotes the name of the command
  • $1 to $9 - denotes a positional parameter. Enclose in double quotes, unless you want to allow parameter splitting (see examples below).
  • $@ - expands the positional parameters, starting from one.
    • "$@": when the expansion occurs within double quotes, each parameter expands to a separate word. That is, "$@" is equivalent to "$1" "$2" ....
    • $@: when the expansion is not within double quotes, each positional parameter expands to a separate word. In contexts where it is performed, those words are subject to further word splitting and pathname expansion.
  • $* - expands the positional parameters, starting from one.
    • "$*": when the expansion occurs within double quotes, it expands to a single word with the value of each parameter separated by space. That is, "$*" is equivalent to "$1 $2 ..."
    • $*: when the expansion is not within double quotes, each positional parameter expands to a separate word. In contexts where it is performed, those words are subject to further word splitting and pathname expansion.

Escape character (\)

Backslash is used to escape special characters - \ (backslash itself), " (double quote) and $ (dollar sign). When backslash is followed by a regular character, it is treated as a literal character (e.g. \a yields \a), so it can be used in Windows paths (e.g. C:\Windows).

Examples

Alias definition Command Result Comment
foo=C:\foo.exe "$1" foo "Hello World!" C:\foo.exe "Hello World!" Parameters will map one to one
foo=C:\foo.exe $1 foo "Hello World!" C:\foo.exe Hello World! Parameters will be expanded
do=cmd.exe /c "$@" do "dir /s" cmd.exe /c "dir /s"
do=cmd.exe /c "$*" do dir /s cmd.exe /c "dir /s"
whatever="$@" whatever git status "git" "status"
*="$0" "$@" git status "git" "status"