Fibre Channel (SAN)

Reply
Occasional Contributor
Posts: 17
Registered: ‎11-26-2013
Accepted Solution

Is it possible to generate a list of port numbers to use with a for loop construct

I would like to something along these lines:

for idx in `echo {0..10}`

 

or

 

for idx in `seq 0 10 `

 

but the cli shell does not recognize these constructs.

 

any ideas other than

 

for idx in 0 1 2 3 4 5 6 7  8 9 10

Regular Contributor
Posts: 161
Registered: ‎12-30-2009

Re: Is it possible to generate a list of port numbers to use with a for loop construct

sansw:root> for I in `seq 0 4`; do echo $I; done
0
1
2
3
4
sansw:root>

 

Works for me  (FOS6.2something).

Please observe I logged on as root, which is unrestricted in its shell, were other users have an restricted shell.

Occasional Contributor
Posts: 17
Registered: ‎11-26-2013

Re: Is it possible to generate a list of port numbers to use with a for loop construct

I was interested in doing this as Admin,  I would like to get a list of portnames for all ports via something like this:

for idx in `seq 0 79`

do

portname -i $idx

done

 

This doesn't appear to work when logged in as admin.  

Regular Contributor
Posts: 161
Registered: ‎12-30-2009

Re: Is it possible to generate a list of port numbers to use with a for loop construct

[ Edited ]

Like i said in my previous reply.

 

root has an unrestricted shell.

Admin users are restricted.

Factory doesn't seem to fit the bill.

 

If you can't use the root user, you can't use those commands on a switch and need to think of an alternative like expect.

Alternatively you can try to create you're own unrestricted user por alter an existing one.

Join the Community

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