LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How commands are executing ? (https://www.linuxquestions.org/questions/linux-server-73/how-commands-are-executing-741655/)

gsiva 07-21-2009 06:01 AM

How commands are executing ?
 
Hi Folks,

I have a small doubt, the binary commands under /bin and /sbin as well as other path binary files, if you peek deep into that, you can find the difference in the way of normal perl programming and some commands will be like binary files. how are the commands executing like the difference in perl scripting and binary files.

rizwanrafique 07-21-2009 08:48 AM

First the file type and whether it is an executable (permission wise) or not.
If it's a text file then first line in is important. In your perl scripts a line that looks something like:

Code:

#!/usr/bin/perl
tells the shell to use /usr/bin/perl to run this script.

This line is called shebang.

Binary files are executed directly.


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