Context:
I’m writing a script that monitors all SFPs on a Brocade SAN switch and needs to iterate over all FabricID contexts.
When I log into a FabricOS 8.2.2d (also with 9.0.1) device through SSH then type:
setcontext <FID>
then the command behaves properly.
But when (as part of my script) I try to run the same command non-interactively via:
ssh <username@hostname> setcontext <FID>
then I get the following error message:
rbash: setcontext: command not found
What puzzles me is that other commands, such as showsfp
, switchshow
(that I intend to run after setcontext
) work in both cases. I don’t understand what’s special about setcontext
that makes it impossible to run non-interactively.
EDIT:
More findings using command -V
(https://man.cx/command):
command -V sfpshow
sfpshow is hashed (/fabos/link_bin/sfpshow)
command -V setcontext
setcontext is a shell builtin
Could that explain why I can run the former but not the latter command through ssh
?