Thursday, March 21, 2013

Re: [LINUX_Newbies] What is bat com exe in Linux?

>
> An exe is an executable program, under linux any file can be marked as
> executable (including shell scripts), every file has a set of
> 'permissions' attached to it, you can see them by typing ls -al at a
> command prompt, one is called the execute permission or 'x'. you can set
> it by typing chmod +x filename. this will make any file executable.
> *
> This I did not understand.
>
> Example:
> I am creating in DOS a programe in Pascal.
> I call it doit.pas.
> Then I compile it and there is a file calles doit.exe.
>
> Now I call doit.exe and it is running.
>


Hi,

Pretty much the same process under linux, you write the pascal in a file
called doit.pas and then compile it. Most compilers on linux (gcc, fpc,
gpc) support an option to name the output file. This is because often
unixy programs push there output to the screen (stdout) so that it can
be used with all the standard cli tools. The compilers often output the
compiled program into a file called a.out which is executable (you just
type ./a.out and it runs. So if you add an option to the compiler line
"-odoit" it will output the compiled file as doit which you run by
typing "./doit"
eg.
fpc doit.pas -odoit
./doit

As linux does not really care about file extensions there is no reason
not to add a '.exe' or whatever to the end but it is not necessary.
eg.
fpc doit.pas -odoit.exe
./doit.exe

The only thing to go wrong is a file not being executable, you get a
permission denied message and need to type:-
chmod +x doit (doit.exe)

Hope this clarifies things a little

Trev.





------------------------------------

To unsubscribe from this list, please email LINUX_Newbies-unsubscribe@yahoogroups.com & you will be removed.Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/LINUX_Newbies/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/LINUX_Newbies/join
(Yahoo! ID required)

<*> To change settings via email:
LINUX_Newbies-digest@yahoogroups.com
LINUX_Newbies-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
LINUX_Newbies-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

No comments:

Post a Comment