You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@iotdb.apache.org by "Haonan Hou (Jira)" <ji...@apache.org> on 2022/03/01 14:18:00 UTC

[jira] [Commented] (IOTDB-2634) Cli exit current cmd.exe instead of the start-cli.bat script file

    [ https://issues.apache.org/jira/browse/IOTDB-2634?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17499562#comment-17499562 ] 

Haonan Hou commented on IOTDB-2634:
-----------------------------------

[~ericpai] Hi, would you like to check this issue if you have time? Thanks so much!

> Cli exit current cmd.exe instead of the start-cli.bat script file
> -----------------------------------------------------------------
>
>                 Key: IOTDB-2634
>                 URL: https://issues.apache.org/jira/browse/IOTDB-2634
>             Project: Apache IoTDB
>          Issue Type: Bug
>          Components: Client/CLI
>         Environment: Windows OS
>            Reporter: Dongming Zhao
>            Priority: Minor
>
> The EXIT command was added to start-cli.bat in IOTDB-2523 to make sure the script exit/return with the correct Exit Code. However, the EXIT *terminates current cmd.exe* instead of just exiting the .bat script file. They are the same while using CLI by double-click on the .bat file, as the activated cmd.exe is temporal and will always be terminated by OS when the script exits. But when we pre-activate a cmd.exe window and call the start-cli.bat by file name/path, the EXIT will close the window and {*}prevent subsequent user commands{*}. (By the way, Windows PowerShell is not affected.) Things are similar when we call the start-cli.bat with CALL clause from another .bat script and no commands after CALL will be executed.
> One of the most affected thing is the register-UDF.bat for UDF-Library, which is using multiple CALL start-cli.bat commands to register all UDF functions. Now the script will exit once after the first CALL is executed, and the following functions will not be registered at all.
> The way to fix this is adding the parameter /B for EXIT command(EXIT /B %ret_code%), which makes the EXIT only affect the current .bat script and return to the caller script or cmd.exe window.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)