...
- Interactive Shell
- Problem
- The Windows shell can only be used as an interactive shell and does not support command or script execution.
- The reason for this behavior is the fact that CopSSH does not support the non-interactive shell
cmd.sh
. - For details see https://www.itefix.net/content/windows-shell-sftp.
- Solution
- Using the "Bash and sFTP shell" with Copssh will work for Windows systems when using the cygwin supported Linux commands.
- Examples for Limitations
- Limitation: the Windows command
set
will not be recognized.- Workaround: use
export
instead.
- Workaround: use
- Limitation: the
%
special character to mark an environment variable such as%VARIABLENAME%
will not be recognized.- Workaround: use
$VARIABLENAME
instead. - Hint: be careful when using mixed case spelling for environment variables.
- Workaround: use
- Limitation: executing chained Windows commands in one line with the command delimiters
&
or&&
will result in executing only the first command.- Workaround: use the Linux command delimiter "
;"
together with the proper Linux command instead.
- Workaround: use the Linux command delimiter "
- Limitation: prefixing a command with
cmd /C
does not execute the specified command.
- Limitation: the Windows command
- Problem
evtl. auf Artikel verlinken; geht denn cmd /C start "clean shell" /I "${EXPLORER_WINPATH}" "${SCRIPT_WINPATH}"
- Beispiel: start "My Notepad" /I c:/tmp/hallo.cmd
- getestet:
- getestet:
mit - mit
cygstart -w launcher.bat ./test.cmd
- Vorraussetzung
cygstart
ist verfügbar, gehört nicht zu Umfang einer Copssh installation- in einer ssh Verbindung passiert nix
- in einem JUnit Test schägt der Test mit dem exit code 127 fehl
- mit
cmd /C start /I ./test.cmd
- in einer ssh Verbindung passiert nix
- in einem JUnit Test hängt der Test sobald versucht wird das
- mit
commando - Kommando remote auszuführen
evtl. auf Artikel verlinken; geht denn
cmd /C start "clean shell" /I "${EXPLORER_WINPATH}" "${SCRIPT_WINPATH}"
Beispiel: start "My Notepad" /I c:/tmp/hallo.cmd
bitvise SSH Server
- Environment Variables
- Limitation: setting environment variables with
set
would not allow using this variable in further commands. - Example: unsuccessful use of an environment variable in a subsequent command:
set TESTFILE=test.txt
echo MYPARAM=myTestParam >> %TESTFILE%- This example shows that %TESTFILE% is not substituted, instead a file with the name
%TESTFILE%
is being created andMYPARAM=myTestParam
is being written to that file.
- Limitation: setting environment variables with
...