• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
Marshal
Posts: 79239
377
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator







This snippet worked for me.
 
reply
    Bookmark Topic Watch Topic
  • New Topic