All Questions
24 questions
0
votes
1
answer
332
views
Shell script not picking up variable in if statement
I have some code that looks like this:
################### - Let's call this section 1
if [ -n "$STUFF_JAVA" ]; then
__LAUNCHER="$STUFF_JAVA"
else
__LAUNCHER="...
0
votes
1
answer
220
views
Confused about java -version [duplicate]
For every program/utility on Unix, I would type the name of the program followed by --version to check its version, like so
program --version
If I understand correctly, the double dash -- is used to ...
2
votes
1
answer
1k
views
Reading Java log input from shell script execution [closed]
I have a unix shell script, and in it I start a Java application. That Java application logs a handful of information upon startup, and I wonder if it's possible for my script to "read" that ...
0
votes
1
answer
960
views
Which shell command returns Java's home path?
I'm aware of the which command but when I run it on Java, I get the following path:
$ which java
/bin/java
What I'm looking for, I think, is the Java path I get when I run the following Maven command:...
1
vote
1
answer
459
views
How to kill an orphan Terminal process
I have a java program that executes several shell files (one by each iteration).
The shell file only has one command, start cross-gdb with a path to a gdbinit file.
The program works fine, but (from ...
-1
votes
2
answers
730
views
How to get all the contents of df -h command as string
I want to have a CRON job which calls a Java program to send a mail if disk space is more than 80%.
Along with it, I want to send the contents of the df -h command also. What I did was create a ...
1
vote
1
answer
594
views
How to output only required parameters in jstat command?
When running the following jstat command on a linux server, we get the following output.
$ jstat -gc $(pidof java)
S0C S1C S0U S1U EC EU OC OU MC MU ...
0
votes
1
answer
1k
views
how to get error from running shell script in java?
i'am using java to run shell script
it works great .
now i want to get errors from this script
for example i have a script and there is an error i want to get the line and a message of that error
...
0
votes
1
answer
749
views
bash file contain executable/binary code
I found this tool and when I downloaded it is a bash executable that contains binary code.
First of all I didn't know this is possible. Does anyone know who this can be done? Also I am not sure how ...
0
votes
1
answer
3k
views
ansible and expect problem
I want to use expect tools in bash script by ansible. first, step my shell script. Checking for $JAVA_HOME variable. I set $JAVA_HOME but in Ansible, I get an error.
My env for $JAVA_HOME:
[root@...
0
votes
2
answers
2k
views
systemd cannot find PID file after YAJSW wrapper startup
I have a systemd startup script for a forking service (let's call it foo) based on YAJSW (Yet Another Java Service Wrapper). The relevant part of the .service file looks like this:
ExecStart=/opt/foo/...
1
vote
1
answer
5k
views
How to set a path variable without root acess? [duplicate]
My college currently uses a very old (like 3 years old) openJDK 1.7 distribution. And being a student, obviously I don't have root privileges. I wanted to use a much later version downloaded a much ...
0
votes
1
answer
17k
views
Any possibility to execute shell script from java file?
I have one Java file named app.java which extracts the servers in my application.
I need to connect to every server in that list and extract the logs. In loop, I have to call script for connecting to ...
1
vote
0
answers
41
views
Is it possible to create aliases that affect services starting?
Currently I have a custom service that executes java in multiple places.
I want to be able to add an option to any executions of java this service will spawn (I'm specifying the error log location, ...
0
votes
1
answer
447
views
Which way is safer to read data from /sys
I am attempting to write a program that will monitor the temperature of various hardware components.
The language I chose for it is Java. Now there are two ways I could read the temperatures:
a) Do ...