Lia Tas

Greenhorn
+ Follow
since May 10, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Lia Tas

Ohhhh you're right I will try that later and will reply !! Thank you .
1 week ago
Yes for all the three

String[] cmd = {"sh test.sh", "user", "pw"};
String[] cmd = {"/c/users/lia/desktop/sh test.sh", "user", "pw"};
String[] cmd = {"/c/users/lia/desktop/test.sh", "user", "pw"};

it is not working
1 week ago
So when I execute this in git bash and it is directly here " ~/Desktop " .
When I do a "sh test.sh" at this position I get the content and it works fine..

In my String I have it like this String[] cmd = {"sh test.sh", "user", "pw"};

When I do it like this : String [] cmd = {/c/users/lia/desktop/test.sh"..} it also does not work
1 week ago
Hi @Dave Tolls

on my desktop xD
1 week ago
Hi again :-)

It works !! But, when execute the shell script for its own on a linux server it works. But when I do export it as a jar file, it gives me an error.. does somebody know why?

"java -jar Test.jar" in Git Bash on Windows (Cannot run program "test.sh".. cannot find file..)

but when I execute it in Git Bash without the jar file, it works fine.. I am confused
1 week ago
Hi

I want to add paramters to the ProcessBuilder. I have a shell script like this

echo "hello"
read user
read pw

I want to call this script "test.sh" with the Process Builder and want to give the user and the pw as arguments. That the script is automatically doing this. Otherwise I always have to type in the user and the password..
The username and the pw is always the same, thats the reason why I want to do this automatically.

Thank you all.
1 week ago
So I have a script like this:

test.sh
echo "hello login"
read user
read pw

And the Java code above ^^ when I execute this script nothing happens it's like frozen
1 week ago
@Dave Tolls

So I have a shell script. If I want to execute this in command line not with a jar file or something like that I have to enter a password and a username.

This action I want to do with a jar file automatically... So I have to give the password and username to the process builder as arguments ? So I tried it but it does not work.. the password is test "user" is also "utest".. so executing the shell script is working but commit the password and username for executing it automatically via the jar file is still not working ☹️
1 week ago
I tried to give it as arguments through the process builder but this is still not working .. so the shell script is not executing because of the password and username ...
1 week ago
@Knute Snortum

I tried it like your code with some changes and it works finde I just added  the Bufferreader for the Output. The problem is, that the output of my Shellscripte is not a string.. it is a password and username query.. It does not work with output string..
1 week ago
Hi thanks for your answer, there are a lot of scripts in the folder. The script should be a specific one. It has to be equal to string. Means that :

if(script.equals("test.sh"){
try{
Process process...)
}
}

And when I try this code I get the message" create process =5, access denied"
1 week ago
Hi , I am new here and I hope that you can understand my problem

I have a shell script which is located in a folder. How can I search for the specific shell script which I want to execute ?

I think I should work with Runtime.exec(command) ..
And I am not sure how to add the path of the folder into the command string. ?

Thank you all :-)
2 weeks ago