Can SHELL commands include uppercase ?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Can SHELL commands include uppercase ?

ソリューションへジャンプ
757件の閲覧回数
walter_gallegos
Contributor I

Apparently names including uppercase as "WriteSpi" are not recognized as a command but "writespi" yes.

Can SHELL commands include uppercase ?

Capture 1:

shell> help

Available commands:

...

   version

   config

   reboot

   WriteSpi

shell> help WriteSpi

Write SPI Ports

Usage: WriteSpi

shell> WriteSpi

Invalid command.  Type 'help' for a list of commands.

shell>

Capture 2:

shell> help

Available commands:

...

   version

   config

   reboot

   writespi

shell> help writespi

Write SPI Ports

Usage: writespi

shell> writespi

CmdsWriteSPI 

shell>

タグ(2)
0 件の賞賛
返信
1 解決策
547件の閲覧回数
matthewkendall
Contributor V

The shell command interpreter converts the command name to lower case before searching the table of registered commands. You can see this in shell.c line 109. Hence, command names must be in lower case. The reason that the help command works correctly with mixed case names is that this code does not convert the command name to lower case before searching the command table. You can see this in sh_help.c line 74.

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
548件の閲覧回数
matthewkendall
Contributor V

The shell command interpreter converts the command name to lower case before searching the table of registered commands. You can see this in shell.c line 109. Hence, command names must be in lower case. The reason that the help command works correctly with mixed case names is that this code does not convert the command name to lower case before searching the command table. You can see this in sh_help.c line 74.

0 件の賞賛
返信
547件の閲覧回数
walter_gallegos
Contributor I

Matthew,

Thank you for answering, apparently we have different MQX versions, not at shell.c line 109 but 113

_io_strtolower(shell_ptr->ARGV[0]);

Do you know the reason of this inconsistencies with the upper/lower case processing ?

0 件の賞賛
返信