On Thu, Jun 18, 2009 at 5:27 PM, Joseph L. Casale
<[email protected]> wrote:
> iscsicli listTargets |grep -i <string> |iscsicli qLoginTarget <output of
> second pipe>
With Bash (from *nix), you can do:
iscsicli qLoginTarget $( iscsicli listTargets | grep -i foo )
Under Microsoft CMD.EXE, it's pretty disgusting (two commands):
FOR /F "usebackq" %%I IN (`iscsicli listTargets | grep -i foo`) DO SET
FOO=%%I
iscsicli qLoginTarget %FOO%
And I'm not even sure you can use a pipe in that context. I think
you might have to put the first ISCSICLI with grep in a separate batch
file, and CALL it.
You may want to consider installing a better shell on Windows. Bash
has been ported to 'doze, and there's PowerShell, of course.
-- Ben
~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~