Link to home
Start Free TrialLog in
Avatar of BILL Carlisle
BILL CarlisleFlag for United States of America

asked on

How would I translate this Linux script to an AIX script?

Hi All,

How would I translate this Linux script to an AIX script?

# User specific aliases and functions
export AS_JAVA=/usr/java/jdk1.7.0_45
export JAVA_HOME=/usr/java/jdk1.7.0_45
export JAVA_BINDIR="${JAVA_HOME}/bin"
echo $PATH | /bin/grep -q -v "${JAVA_BINDIR}"
if [ $? -eq 0 ]; then export PATH="${PATH}:${JAVA_BINDIR}"; fi

export GLASSFISH_PARENT=/u01/oracle/glassfish
export GLASSFISH_HOME=/u01/oracle/glassfish/glassfish
echo $PATH | /bin/grep -q -v "${GLASSFISH_HOME}/bin"
if [ $? -eq 0 ]; then export PATH="${PATH}:${GLASSFISH_HOME}/bin"; fi

Open in new window


I am going in circles.. I am a PL/SQL programmer.. trying to get APEX installed.
Thank you so much,

Bill
SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BILL Carlisle

ASKER

Thank you for your response
I will be testing in the morning
I just took for granted that it would be big-time different
Thanks again,
Bill
Please take care of the Java paths! They're certainly not standard AIX!
to see existing path use #set command and accordingly modify the same.

TY/SA
Ok, it was weird that when I changed to glassfsh user it didn't automatically change from root directory / to /home/glassfsh, but I figured that out.. ha, don't know much even about unix..
:)

$ ls -ld /usr/java*
drwxr-xr-x    5 root     dba            512 Feb 18 2007  /usr/java131
drwxr-xr-x    7 oradev   oradev    512 Nov 11 2010  /usr/java14
drwxr-xr-x    7 bin      bin             512 Jul 15 2011  /usr/java5
drwxr-xr-x    7 bin      bin             512 Jul 15 2011  /usr/java5_64
drwxr-xr-x    7 bin      bin             512 Jun 28 2013  /usr/java6
drwxr-xr-x    7 bin      bin             512 Dec  3 15:37 /usr/java71

so, I used /usr/java71 as my java path


# User specific aliases and functions
export AS_JAVA=/usr/java71
export JAVA_HOME=/usr/java71
export JAVA_BINDIR="${JAVA_HOME}/bin"
echo $PATH | /bin/grep -q -v "${JAVA_BINDIR}"
if [ $? -eq 0 ]; then export PATH="${PATH}:${JAVA_BINDIR}"; fi

export GLASSFISH_PARENT=/u01/oracle/glassfish
export GLASSFISH_HOME=/u01/oracle/glassfish/glassfish
echo $PATH | /bin/grep -q -v "${GLASSFISH_HOME}/bin"
if [ $? -eq 0 ]; then export PATH="${PATH}:${GLASSFISH_HOME}/bin"; fi

this is what I used, think I will keep it to what our doc has.. as long as it work fine.

$ exit

# whoami
root
# su glassfsh
$ java -version
java version "1.1.8"

Ok, I exited glassfsh, then went back in as glassfsh to run the .profile I just updated (because I forgot the command to run it)

then as you see did a java -version
why is it showing "1.1.8" ??
Yep, it is not seeing the java71 version

*******************************************************************************
*                                                                             *
*                                                                             *
*  Welcome to AIX Version 6.1!                                                *
*                                                                             *
*                                                                             *
*  Please see the README file in /usr/lpp/bos for information pertinent to    *
*  this release of the AIX Operating System.                                  *
*                                                                             *
*                                                                             *
*******************************************************************************
# su glassfsh
$ pwd
/
$ cd /home/glassfsh
$ pwd
/home/glassfsh
$ /u01/oracle/glassfish/bin/asadmin start-domain
-jar: illegal argument
Usage: java [-options] class

where options include:
    -help             print out this message
    -version          print out the build version
    -fullversion      print out the full version information
    -v -verbose       turn on verbose mode
    -debug            enable remote JAVA debugging
    -noasyncgc        don't allow asynchronous garbage collection
    -verbosegc        print a message when garbage collection occurs
    -noclassgc        disable class garbage collection
    -cs -checksource  check if source is newer when loading classes
    -ss<number>       set the maximum native stack size for any thread
    -oss<number>      set the maximum Java stack size for any thread
    -ms<number>       set the initial Java heap size
    -mx<number>       set the maximum Java heap size
    -D<name>=<value>  set a system property
    -classpath <directories separated by colons>
                      list directories in which to look for classes
    -prof[:<file>]    output profiling data to ./java.prof or ./<file>
    -verify           verify all classes when read in
    -verifyremote     verify classes read in over the network [default]
    -noverify         do not verify any class

 DEFAULTS:
    -ss: 256K, -oss: 400K, -ms: 1M, -mx: 32M
$

Open in new window


doesn't seem to be running the ,profile

$ vi .profile   (just saw the file, edited it, saved it - it is there)
$ . .profile
ksh: .profile:  not found
$

. .profile the wrong command to run it from this shell?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Okay, so if they don't want to run the whole system with Java 7 then I would just leave it in the .profile for glassfish, right?
But why, when I logged totally out, and then log totally back in as glassfish It still didn't pick up the new changes in my profile?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thx Joe, I usually do use the dash but I thought I got an error early on with this AIX so I stopped using it. Probably was some other error..

Great, I'm in! Wohoo! You are the best..

# su - glassfsh
[YOU HAVE NEW MAIL]
$ java -version
java version "1.1.8"
$ /u01/oracle/glassfish/bin/asadmin start-domain
Waiting for domain1 to start ......................
Successfully started the domain : domain1
domain  Location: /u01/oracle/glassfish/glassfish/domains/domain1
Log File: /u01/oracle/glassfish/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.

Open in new window

thanks for your input too Sandy!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
M sorry but i am laughing here :D :)  

Thanks guys :)
Ha! I have another post going with a brother printer and a virus and his name was Joe!
Just tried looking up you name but I guess you don't have one.. :)

What is a woolmilkporc?
If you're interested - I explained "woolmilkporc" in my profile:
 https://www.experts-exchange.com/M_1730518.html

And if you want to know my real name - check EE's MVE Gamma class.

Thx for the points!
Got it!
Thx N!
Just created another question :)

AIX - Can you verify my assumption? Create Script for Service (daemon)