Fibre Channel (SAN)

Reply
Occasional Visitor
Posts: 1
Registered: ‎10-19-2013
Accepted Solution

echo command no longer working

Hi,

 

I used to generate scripts which configure zoning on Brocade switches. The generated scripts starts with

 

 

#!/bin/sh

cat << EOF | ssh admin@switch

version

chassisname

echo yes | cfgclear

 

...

 

EOF

 

 

After recent upgrade to FabricOS v7.4.1d this no longer works becourse the echo command is no longer availible:

 

 

switch:FID128:admin> echo "Hello world"

rbash: echo: restricted

 

 

Is there a way to reactivate the echo command?

Or another way to clear the configuration without user interaction?

I don't want to use more complicated perl or python scripts, I like the simplicity of the shell scripts.

 

Best regards,

Jan

Brocade Moderator
Posts: 382
Registered: ‎03-29-2011

Re: echo command no longer working

Hi Jan,

 

the echo command have been removed from admin (accounts) in FOS 7.4.1d and in FOS 8.0.1a, so you need to look for an alternate solution. I am not aware of any way to re-activate the echo command. A starting point might be:

 

[linux] $ echo y | ssh admin@172.29.244.89 "firmwareshow;date;cfgclear;cfgshow;exit"
admin@172.29.244.89's password:
Appl     Primary/Secondary Versions
------------------------------------------
FOS      v7.4.1c
         v7.4.1c
Fri Sep 23 01:36:01 GMT-1 2016
The Clear All action will clear all Aliases, Zones, FA Zones
and configurations in the Defined configuration.
Run cfgSave to commit the transaction or cfgTransAbort to
cancel the transaction.
Do you really want to clear all configurations?  (yes, y, no, n): [no] Defined configuration:
 no configuration defined

Effective configuration:
 no configuration in effect

 

kind regards

 

Martin




If this provided you with a solution to this issue, please mark it with the button at the bottom "Accept as solution".


Any and all information provided by me is not reviewed, approved or endorsed by Brocade and is provided solely as a convenience for Brocade customers. All systems and all networks are different and unique. If you have a service affecting network problem, please open a TAC service request for service through Brocade, or through your OEM equipment provider. If this provided you with a solution to this issue, please mark it with the button at the bottom "Accept as solution"
Valued Contributor
Posts: 551
Registered: ‎03-20-2011

Re: echo command no longer working

I hope echo is still available from under the root account.
Brocade Moderator
Posts: 382
Registered: ‎03-29-2011

Re: echo command no longer working

Hi Alexey,

 

echo is removed from admin / user account (restricted bash shell).  Still available under root.

 

kind regards,

 

Martin




If this provided you with a solution to this issue, please mark it with the button at the bottom "Accept as solution".


Any and all information provided by me is not reviewed, approved or endorsed by Brocade and is provided solely as a convenience for Brocade customers. All systems and all networks are different and unique. If you have a service affecting network problem, please open a TAC service request for service through Brocade, or through your OEM equipment provider. If this provided you with a solution to this issue, please mark it with the button at the bottom "Accept as solution"
Brocade Moderator
Posts: 382
Registered: ‎03-29-2011

Re: echo command no longer working

All,

 

with FOS 7.4.1e released yesterday, a small enhancement is included

 

  • Add –force or –f option to cfgSave, cfgEnable, and cfgDisable command to bypass the confirmation prompt

Link to the releasenotes (from another recent post)

 

https://community.brocade.com/dtscp75322/attachments/dtscp75322/fibre/24750/1/v7.4.1e_releasenotes_v1.0.pdf




If this provided you with a solution to this issue, please mark it with the button at the bottom "Accept as solution".


Any and all information provided by me is not reviewed, approved or endorsed by Brocade and is provided solely as a convenience for Brocade customers. All systems and all networks are different and unique. If you have a service affecting network problem, please open a TAC service request for service through Brocade, or through your OEM equipment provider. If this provided you with a solution to this issue, please mark it with the button at the bottom "Accept as solution"
Occasional Visitor
Posts: 1
Registered: ‎11-07-2016

Re: echo command no longer working

Hi,

 

apropos releasenotes - why is this "feature" with the echo-command not mentioned in the releasenotes?

And what is the reason for it?

 

I find it very odd why you have to sign in as root to use the echo command.

During daily maintenance you should not have to sign in as root.

 

I use the echo command a lot in my scripts. Now a lot of them is not working any more - just a lot of "rbash:  echo: restricted".

 

Not happy with this meaningless change. :-(

Brocade Moderator
Posts: 382
Registered: ‎03-29-2011

Re: echo command no longer working

Hi Henrik,

 

because of hardning (security) of FOS, the echo command (among other commands) was removed from the admin account (rbash shell). I am CLI persom myself and like to script / automate as much as possibe, so this threw a spammer in my scripts, too.




If this provided you with a solution to this issue, please mark it with the button at the bottom "Accept as solution".


Any and all information provided by me is not reviewed, approved or endorsed by Brocade and is provided solely as a convenience for Brocade customers. All systems and all networks are different and unique. If you have a service affecting network problem, please open a TAC service request for service through Brocade, or through your OEM equipment provider. If this provided you with a solution to this issue, please mark it with the button at the bottom "Accept as solution"
Highlighted
Visitor
Posts: 1
Registered: ‎04-03-2012

Re: echo command no longer working

Hi Henrik,

we ran into the same issue and we had to find another solution to make our scripts work again. We replaced echo command with printf in our Scripts and everything works again - hopefully brocade will mention similar changes in the release notes if they remove some commands.

switch1:user> echo "test"
rbash: echo: restricted


switch1:user>


switch1:user>
switch1:user> printf "test\n"
test
switch1:user>

Join the Community

Get quick and easy access to valuable resource designed to help you manage your Brocade Network.

Download FREE NVMe eBook