> Oops, I'm sorry I wasnt clear.
> The "ls" and "dir" was just examples of a cmd. Bad examples :)
>
> This is a one-liner which is same across all platforms and I wanted to
> suppress the error msgs from it in case anything went wrong. Theres no
> real need to understand what went wrong with the cmd.
If you're using Java's Runtime.exec to run them, then standard error and
standard output are already captured for you, so you can just read and
ignore the contents. If you're running the commands some other way, you
need to tell us how you're doing the running.

Signature
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
Prabh - 27 Feb 2004 23:02 GMT
> > Oops, I'm sorry I wasnt clear.
> > The "ls" and "dir" was just examples of a cmd. Bad examples :)
[quoted text clipped - 7 lines]
> ignore the contents. If you're running the commands some other way, you
> need to tell us how you're doing the running.
I'm sorry if I was not clear.
I'm writing a new version control task for our ANT build process.
The version control is ClearCase and the task is to run ClearCase's
command:
"cleartool ls -d", which would run an ls on the present working dir.
Relevant portion:
====================================================
public class CCLs extends ClearCase
{
Commandline cmdLine = new Commandline () ;
cmdLine.setExecutable(getClearToolCommand()) ;
cmdLine.createArgument().setValue("ls") ;
moreOptions(cmdLine) ;
.....
}
In moreOptions:
=========================
public void moreOptions(Commandline more_cmdLine)
{
more_cmdLine.createArgument().setValue("-d");
more_cmdLine.createArgument().setValue(".");
....
}
The above tries to construct a cmd-line: "cleartool ls -d ."
I wanted to add "redirect STDERR" and suppress error msgs in case the
above cmd fails for any reason. Its not malicious and theres no reason
to track it.
I was thinking of adding "> /dev/null" to the above construct.
Thanks for your time,
Prab
Chris Smith - 28 Feb 2004 18:47 GMT
> I'm sorry if I was not clear.
> I'm writing a new version control task for our ANT build process.
> The version control is ClearCase and the task is to run ClearCase's
> command:
Okay. Sorry, I'm not familiar with the Commandline class you use below.
Perhaps someone who knows what third-party tool you're using there can
help you.

Signature
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation