Solaris problem

I am using the parameter below for creating a log of garbage collection.

-verbose:gc -Xloggc:/opt/bea/GCfiles/gc.$$

In the log name "gc.$$" would fetch the PID and create the log with that name as gc.PID

It is working in Linux. But failing in Solaris.

The "$$" is not fetching the PID in solaris. What do I do?
RazAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

omarfaridCommented:
what shell are you using on both linux and solaris? can you run your script in debug mode?

if you run

echo $$

on solaris, what do you get?
0
RazAuthor Commented:
im using bash.

echo $$ gives the PID on both Linux and solaris.
0
omarfaridCommented:
so, where this is failing?
0
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

RazAuthor Commented:
In solaris,
If I put the parameter as

-verbose:gc -Xloggc:/opt/bea/GCfiles/gc.log

the log is creating as gc.log.

Bot if I put "gc.$$" the file is creating in an un readable format (currupted).
0
omarfaridCommented:
is it the filename that is corrupted or the file content?
0
RazAuthor Commented:
file name is coming as gc.$$ (as it is). file content is getting corrupted
0
omarfaridCommented:
can you remove " around $$ ?
0
RazAuthor Commented:
I didnt put quotes to it.
0
omarfaridCommented:
is this part of a script? if so, then can you share sample script?
0
RazAuthor Commented:
On solaris, $$ will give output only if it is run manually. It doesnt work when it is being run as a script for naming the log.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RazAuthor Commented:
The comments by omarfarid are not helpful. I have found the solution myself. In solaris it doesnt work while naming the log.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.