LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Extracting BINs (https://www.linuxquestions.org/questions/linux-general-1/extracting-bins-267463/)

caps_phisto 12-17-2004 01:33 PM

Extracting BINs
 
I have a problem concerning a extracting a BIN using a script. I have followed the instructions found here: http://java.sun.com/products/archive...all-linux.html
for installing the Self-Extracting file.

My script looks like this: (well a small part anyway, the whole thing is around 220 lines)
Code:

cp j2sdk-1_4_2_06-linux-i586.bin /usr/java
/usr/java/./j2sdk-1_4_2_06-linux-i586.bin

When I do these commands manually the bin extracts in /usr/java. But when I execute this script the files are extracted to where ever my script is. For example if I run the script in my home directory the files are extracted there instead of /usr/java.

Is there anyway I can force it to extract to the correct directory without changing directories in my script?

Thanks in advance.

bigrigdriver 12-17-2004 07:46 PM

I believe there is a simple way.

Quote:

cp j2sdk-1_4_2_06-linux-i586.bin /usr/java /usr/java/./j2sdk-1_4_2_06-linux-i586.bin
insert the command 'cd /usr/java' between the two lines of code, like this:

cp j2sdk-1_4_2_06-linux-i586.bin /usr/java
cd /usr/java
/usr/java/./j2sdk-1_4_2_06-linux-i586.bin

bash should then change to /usr/java before executing the last line.


All times are GMT -5. The time now is 05:57 AM.