LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Self extracting .bin files (https://www.linuxquestions.org/questions/linux-software-2/self-extracting-bin-files-278037/)

manticor 01-15-2005 06:31 AM

Self extracting .bin files
 
Hi, guys... This is my first post here, so um... HI!

Anyway, to the issue in hand:

I recently installed RedHat 9 on my laptop. As far as it goes, it works absolutely perfectly. The problem is this: I'm trying to install things, and downloads keep coming up as "self extracting .bin files" on the site i download from (namely Sun Java). Well, i'm not that familiar with Linux, so i download the file and double click. The problem is this: All i get come up on the screen is text. It looks like a script of some kind, but the problem is that it dosnt do anything: It simply displays the text!

Arg, can someone please help me with this problem - im trying desperately to install stuff (including the JaveRE files) but I can't!!!


Thanks in advance

frob23 01-15-2005 06:33 AM

Open a terminal.

Code:

chmod +x name_of_self_extracting.bin
./name_of_self_extracting.bin

Then report back if this still doesn't work.

manticor 01-15-2005 06:39 AM

OK, the first line seemed to work fine... Then, when I put in the second line, I got this redurn:

Quote:

./ is a directory
When I tried it without the "./" on the start, it simply did the whole command not recognised thing...

Thanks for the help so far, and thanks for any more help!

Edit: Ah, I typed it wrong! All works fine, thanks very much for your help!

frob23 01-15-2005 07:00 AM

lol, :) glad to hear you got it working.

the ./ is used to tell the shell to look in the current directory for the file. That way it would see it even if it wasn't in a place you would normally look for an executable file.

manticor 01-16-2005 11:25 AM

Yeah, thanks again...

Just out of interest, where does it normally look then, if not in the current directory? (my only real experience with using command lines is when I used to use DOS to try to get past the security in school ;) )

davcefai 01-16-2005 01:09 PM

Path
 
DOS and Windows first look in the current directory, then in the directories listed in the PATH variable. To see this, in a console window, enter the command:

echo $PATH

*nix systems do not look in the current directory. This seems to be a "philosophical" thing. You shouldn't normally be in the program directories but somewhere in your home tree.

frob23 01-16-2005 02:39 PM

It is more than just philosophical. It is security related. Remember that any file can be executable on *nix and that many common commands are programs and not build into the shell. If some malicious person put the following into a file named /home/eviluser/private/ls
Code:

#!/bin/sh
rm -rvf ~/

And clueless_user wandered into their directory, saw private and entered it, then decided to list the files it contained (before possible looking at the contents of some)... they would unwittingly execute the /home/eviluser/private/ls and not the /bin/ls they intended. Now everything in their home directory has been silently wiped out. Some would say they shouldn't be snooping... but they would be the buttholes with no sympathy.

You shouldn't even have ./ as the END of your path because if you mistype a command and there is a bad executable there, you don't want it to run. Keep the current directory out of your path. If you want to run your own private programs... add them to ~/bin and add that to your path... you can execute them from anywhere and since you are the only one who can put files there, you will know they are trusted.

davcefai 01-16-2005 11:52 PM

Good Point
 
I never considered the evil_user scenario. (Nor do I have ./ in my path!)

manticor 01-17-2005 11:12 AM

Cheers, guys... Help much appreciated.


All times are GMT -5. The time now is 03:22 PM.