This post is more than 5 years old

19 Posts

2287

November 19th, 2013 09:00

Help with batch file for symcli syntax please

I am trying to find Masking View Names via Windows Batch File. This is based on something I found in this discussion group but the variable returns (echos) it's own name out to file rather than the result of findstr as it should. Any thoughts?

for /f %I in nrMETA.txt do symaccess -sid 01 list -type stor -dev %I -v | set %m = (findstr "Masking View Names") | echo %i %m >> Views.txt

This returns a list as follows:

0B0C % m

0BF5 % m

...

I need %m to be returned as the result of findstr and not itself. Thanks all!

OR is there a better way to approach this in powershell or via Unisphere?

3 Apprentice

 • 

465 Posts

November 19th, 2013 14:00

for /f %i in (tdev.txt) do symaccess -sid 01 list -type stor -dev %%i -v | for /F "delims=" %a in ('findstr /C:"Masking View Names"') do echo %i %a >>views.txt

286 Posts

November 19th, 2013 09:00

Yeah actually I would highly recommend using the PowerShell cmdlets we bundle in with the EMC Storage Integrator. We have a cmdlet called Get-EmcLunMaskingView that when combined with standard PowerShell scripting will get you want you want. It of course isnt quite as advanced Solutions Enabler in the sense that you can't do everything it does, but common tasks are available and it is quite easy to script. ESI 3.0.1 just came out on Monday. Find some info on it here in a post I just did http://codyhosterman.com/2013/11/18/emc-storage-integrator-3-0-1-powershell-cmdlets-for-fast-vp-and-metas/

19 Posts

November 19th, 2013 10:00

Yup, looks useful and we have an SE working with one of our guys on implementing ESI but for now I'm stuck with batch or using powershell to execute symcli commands.
Anyone - any other ideas on my syntax? This for loop logic is something I need to do in a number of areas..
Thanks again.

0 events found

No Events found!

Top