LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   linux .exe? (https://www.linuxquestions.org/questions/linux-general-1/linux-exe-8243/)

loop 11-02-2001 09:27 AM

linux .exe?
 
What is an executable file extention in linux? In windows it is a .exe or could even be .bat. Is it the same, or if/can an .exe run under linux?

-Thanks, Loop :) :newbie:

syxxpac023 11-02-2001 09:55 AM

Actually... Linux doesn't use file extensions. You just have the set the permissions of the file to executable using chmod. I don't think that Windows executables will run in Linux. You'll probably have to find a Linux version of the program you are wishing to run or get software that allows you to do this which I'm not well versed in but I thought I'd offer a few words to get you started at least.

acid_kewpie 11-02-2001 10:55 AM

seems to me that the whole establishment of .exe just stems from the joint fact the 1) DOS was always very simple, and b) FAT32 is just plain lame, and still relies on a couple of letters to say wether the file is a program or not. which is a bit lame really.

linux and all unix variants, and pretty much all decent OS's use a better system of attributes to define such a thing. File extensions are still frequently used in linux, but really only for information to the user, not the os. you can still call a file what you want, and give it to an app, and it'll do what it can with it...

linux and windows are different operating systems, and have next to nothing in common as far as the user can see really. programs compiled on one system will not work on the other natively. Brain surgeons and jet pilots might both be very clever people, but tell a surgeon to fly this plane to cuba... and he'll be stuffed...

to run windows app on linux, you're only optino is to use wine, unless you pay money for win4lin etc... but wine is well.. a bit toss. runs office fine tho

Citizen Bleys 11-02-2001 11:57 AM

Usually anything with the extension .sh, .pl, or .php will execute, but it's not the extention that makes it executable. Load the file into a text editor and you'll see a line that looks like this:

#!/usr/bin/perl

which tells the OS where to look for the script interpreter. Those aren't really executable files, though, but <i>scripts</i>, which are like .bat files for Linux.

EDIT: Want a good script? Create a file with the following contents: (between the dashed lines, not including the dashed lines)
-----------------------
#!/bin/bash

./configure
make
make install
---------------------------

Save it with any name (i.e., install.sh), and chmod it to be executable (i.e., chmod 777 install.sh), then put it somewhere in the path (/bin would work). Then you can install any tarball software with one command.


acid_kewpie 11-02-2001 12:34 PM

hmm, i personally wouldn't touch that script with a big stick... well not without some error checking... what if ./configure fails?

./configure
if [ $? -le 0 ] ; then
make;
if [ $? -le 0 ] ; then
make install;
fi
fi

ahh that's not quite right.. but you get the idea....

isajera 11-02-2001 01:09 PM

it wouldn't do too much harm. probably. the only problem the script would have is during make install - if the user isn't root, it might not have permission to install at certain directories. but, if configure fails, then make will fail too, and make install won't get nearly as far.


All times are GMT -5. The time now is 12:28 AM.