Re: Redirect Output in Windows dsmadmc
2002-07-25 19:18:36
Like Unix, the windows "shell" has special characters too, with > being
one of them. You can use quotes or escape the special character, similar
to the unix way of things. The escape character for windows is ^.
The following works:
dsmadmc -id=admin -pa=xxxx select * from nodes where max_mp_allowed^>1
redirection:
dsmadmc -id=admin -pa=xxxx select * from nodes where max_mp_allowed^>1
>test.txt
This, along with a ton of other useful information can be found in the
excellent book "Windows NT Shell Scripting" by Tim Hill.
===================================================
John Monahan
Senior Consultant Enterprise Solutions
Computech Resources, Inc.
Office: 952-833-0930 ext 109
Cell: 952-484-5435
http://www.compures.com
===================================================
Andy Raibeck
<storman AT US DOT IBM.C To: ADSM-L AT
VM.MARIST DOT EDU
OM> cc:
Sent by: "ADSM: Subject: Re: Redirect Output in
Windows dsmadmc
Dist Stor
Manager"
<[email protected]
.EDU>
07/25/2002 08:48
AM
Please respond to
"ADSM: Dist Stor
Manager"
That one is a little tougher. The problem is that the Windows command
processor doesn't pass the '>' symbol to the program (to any program, not
just TSM). You can verify this for yourself by compiling this simple C
program:
========================================
/* args.c */
#include <stdio.h>
int main(int argc, char *argv[])
{
int i = 0;
for (i = 0; i < argc; i++)
printf("argv[%d] = %s\n", i, argv[i]);
return 0;
}
========================================
Example output:
========================================
C:\MyPrograms\args>args select * from nodes where max_mp_allowed>1
C:\MyPrograms\args>type 1
argv[0] = args
argv[1] = select
argv[2] = *
argv[3] = from
argv[4] = nodes
argv[5] = where
argv[6] = max_mp_allowed
========================================
As you can see, the program never even sees the > symbol, so it can't
possibly process it.
One thing I tried that seems to work, is to embed the entire admin command
in quotes, like this:
dsmadmc -id=admin -pa=xxxxx
"select * from nodes where max_mp_allowed>1"
and to redirect, you can do this:
dsmadmc -id=admin -pa=xxxxx
"select * from nodes where max_mp_allowed>1" > sel.out
Regards,
Andy
Andy Raibeck
IBM Software Group
Tivoli Storage Manager Client Development
Internal Notes e-mail: Andrew Raibeck/Tucson/IBM@IBMUS
Internet e-mail: storman AT us.eyebm DOT com (change eye to i to reply)
The only dumb question is the one that goes unasked.
The command line is your friend.
"Good enough" is the enemy of excellence.
Richard Cowen <richard_cowen AT CNT DOT COM>
Sent by: "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>
07/25/2002 05:00
Please respond to "ADSM: Dist Stor Manager"
To: ADSM-L AT VM.MARIST DOT EDU
cc:
Subject: Re: Redirect Output in Windows dsmadmc
When will we be able to do this with a select statement and use a "greater
than" symbol under windows?
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- Redirect Output in Windows dsmadmc, Gerhard Rentschler
- Re: Redirect Output in Windows dsmadmc, Seay, Paul
- Re: Redirect Output in Windows dsmadmc, Levinson, Donald A.
- Re: Redirect Output in Windows dsmadmc, Andy Raibeck
- Re: Redirect Output in Windows dsmadmc, Richard Cowen
- Re: Redirect Output in Windows dsmadmc, Andy Raibeck
- Re: Redirect Output in Windows dsmadmc, Ilja G. Coolen
- Re: Redirect Output in Windows dsmadmc, Frost, Dave
- Re: Redirect Output in Windows dsmadmc,
John Monahan <=
- Re: Redirect Output in Windows dsmadmc, Sjerps, Marco
- Re: Redirect Output in Windows dsmadmc, Andy Raibeck
|
|
|