• Post Reply Bookmark Topic Watch Topic
  • New Topic

can't exected md5sum command. cat u* p* r* | md5sum > auth.txt  RSS feed

 
snajeeb shah
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I make a file using . then in java I want to execute the command to compare if check some is valid.

The problem is I can't see the result of the command. It return in console but shows int value regardless it matched or not.
How would I know if the check is executed and result is .
 
Campbell Ritchie
Marshal
Posts: 56578
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You appear to have posted in the wrong place. I shall move this thread to a more appropriate location and duplicate it in another forum.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
snajeeb shah wrote:then in java I want to execute the command to compare if check some is valid.

That's not one command, it's two that are combined using the pipe separator. To do this in Java you have two choices: create a shell script that contains that line and call the shell script, or create two processes and redirect output from the first to the input of the second yourself.

Also, have you already read When Runtime.exec() won't? Even if you're using a ProcessBuilder, the article is still a required read when dealing with external processes in Java.
 
snajeeb shah
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator







This snippet worked for me.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!