One of the monitoring tools in Java is called `jps`, and it monitors all Java processes that are run by the user, an example output would be like this:
3459 Jps
2348 test
2311 Util
where the first column represents Process IDs and the second column represents Java processes names. Therefore, if I wanted to find the process ID for some Java process, say test, I could type `jps | grep test` and then take the first argument in the line, which would be the process ID.
Now I had an idea to do it in a simpler way (rather than just writing a C or Java program), I could write a simple sh script that goes like this (call it tokenizer)
and by typing `chmod +x tokenizer` and then: `jps | grep test | tokenizer` I would think I should get 2348 as an output to the shell, which is the PID for `test` Java process, but that did not happen. Anybody know why?
Keeping in mind that I'm relatively comfortable with programming in general but very new to unix and korn/bourne shell scripts..
I'm using awk on a CSV file, and then performing calculations and operations on specific fields within specific records. The CSV file I'm working with has about 600... (2 Replies)
Does anyone know how to test if an ethernet interface is alive, or accepting connections? Here is the scenario - I have rsc and sc console interfaces on some Suns. There are some sporadic vulnerability scans that send them out to lunch when they run the scans. I have to login to the host and reset... (0 Replies)
I'm new to the script programming and I have this piece of code (repeatedly used) in my program:
while :
do
................
ans=`ckyorn -p "Do you want to continue?"`
if || || || ; then
break
elif || ; then
echo "Aborting..."
exit... (2 Replies)
Getting some errors when i run this script..
./xml_load_process.txt: -jar: not found
./xml_load_process.txt: syntax error at line 31 : `then' unmatched
any ideas...really miffed at my inability to spot the error....
#!/bin/ksh
# set -o xtrace
# set environment variables
export... (3 Replies)
my issue now is i have a txt file containing a list like below
i want to create a script that will add a constant text "Find this name" at the start and "at your directory" at the end. every line should be added by phrase at the start and end.
Each line of the file should look like "Find... (4 Replies)
Hi All,
I have String i want to tokenize based on one delimiter.
Original String is -pComments.properties,-iPELF4
i want to tokenize the original string based on ',' (comma) as delimiter and collect them individually like
string1=-pComments.properties
string2=-iPELF4
... (1 Reply)
I have a string that looks like this:
blahblahblah_^substring^_blahblahblah
I need to extract substring, the bit between the ^ characters, into another string variable. This will be in a bash shell script.
Thanks. (2 Replies)
Hi all, I now have project in UNIX Solaris and I want to have some new ideas to execute it, so I hope you help me finding new ideas in scripting or some infrastructure .bye (1 Reply)
Supposed I have a string in the format:
<service_name> = <ldap user FDN> : <password>
like
DNS = cn=user1,o=company : pwd
I want to tokenize like:
service name:DNS
UserName: cn=user1,o=company
Password: pwd.
Because of the '=' sign between Service Name and LDAP Name I not... (8 Replies)
I am trying to make a script that will execute different things by the input
Input:
#/bin/bash
echo "Test script"
read cake
if
then
echo "cake it is"
fi
Output:
1
: bad variable nameake
test.sh: 8: test.sh: Syntax error: end of file unexpected (expecting "then") (0 Replies)
Discussion started by: kitay
0 Replies
LEARN ABOUT MOJAVE
jmap
jmap(1) General Commands Manual jmap(1)NAME
jmap - memory map
SYNOPSIS
jmap [ option ] pid
jmap [ option ] executable core
jmap [ option ] [ server-id@ ] remote-hostname-or-IP
DESCRIPTION
jmap prints shared object memory maps or heap memory details of a given process or core file or remote debug server.
NOTE - This utility is unsupported and may or may not be available in future versions of the J2SE SDK. jmap is not currently available on
Windows platforms or on the Linux Itanium platform.
PARAMETERS
option Options are mutually exclusive. Option, if used, shouldfollow immediately after the command name.
pid process id for which the memory map is to be printed. The process must be a Java process. To get a list of Java processes
running on a machine, jps may be used.
executable Java executable from which the core dump was produced.
core core file for which the memory map is to be printed.
remote-hostname-or-IP
remote debug server's (see jsadebugd) hostname or IP address.
server-id optional unique id, if multiple debug servers are running on the same remote host.
OPTIONS
<no option> When no option is used jmap prints shared object mappings. For each shared object loaded in the target VM, start address,
the size of the mapping, and the full path of the shared object file are printed. This is similar to the Solaris pmap util-
ity.
-heap Prints a heap summary. GC algorithm used, heap configuration and generation wise heap usage are printed.
-histo Prints a histogram of the heap. For each Java class, number of objects, memory size in bytes, and fully qualified class
names are printed. VM internal class names are printed with '*' prefix.
-permstat Prints class loader wise statistics of permanent generation of Java heap. For each class loader, its name, liveness,
address, parent class loader, and the number and size of classes it has loaded are printed.
-h Prints a help message.
-help Prints a help message.
SEE ALSO pmap(1)jps(1)jsadebugd(1)
13 June 2004 jmap(1)