Can SHELL commands include uppercase ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can SHELL commands include uppercase ?

Jump to solution
604 Views
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>

Tags (2)
0 Kudos
1 Solution
394 Views
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.

View solution in original post

0 Kudos
2 Replies
395 Views
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 Kudos
394 Views
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 Kudos