how does unix identify C and other language code!


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers how does unix identify C and other language code!
# 1  
Old 01-20-2004
how does unix identify C and other language code!

Hello everyone,
this question is probably simple for you ppl but i am jus a beginner and still learing. i was wondering if someone could tell me that how does unix identify different program codes in it's environment.
for example, unix recognises this C code in the body of any script. how does that work? or for instance if it was something written in perl, it would be supported!?

#include <stdio.h>
FILE *popen(const char *command, const char *open_mode);
int pclose(FILE *stream_to_close);

Can someone please help me on that!?
Thank You!
# 2  
Old 01-21-2004
What do you mean exactly?

Are you curious as to why some programs, like text editors manage to identify which programming language a piece of code represents? File extension, or even existence of certain keywords particular to a language can help identify the programming language used with a bit of parsing. After all, these are all heuristic methods that practically works quite well with sometimes quite accurate guesses but they are not necessarily correct.

I don't think Unix by itself recognizes the language used. For example, if you want to compile a C program you need to explicitly invoke 'cc'; while for a Perl program you need to invoke 'perl' (or as the top shebang line). There is no mystery in there.
# 3  
Old 01-21-2004
Re: how does unix identify C and other language code!

Quote:
Originally posted by a25khan
for example, unix recognises this C code in the body of any script.

#include <stdio.h>
FILE *popen(const char *command, const char *open_mode);
int pclose(FILE *stream_to_close);
Excuse me??!!! Recognition of c code is not mandated by Posix for any interpreter.

csh
tcsh
sh
ksh
bash

are a few shells that can do no such thing.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to identify whether the script is in Unix format or not ?

Hi All, I have the below scenario in my environment Developers used to copy file from windows to Linux box. Some time on the copied file developers miss to run the dos2unix utility. Because of this script gets failed during the execution. Most of the failures are due to the dos2unix format... (7 Replies)
Discussion started by: kalpeer
7 Replies

2. AIX

How to Identify long running unix processes

Hi All, Need an urgent help, I have a requirement to find long running unix processes.. I have tried the below commands, but not succeed. I need to arrange the unix processess in an order of elapsed time (high to low) that runs in a system. For Eg: Consider we have 3 processes, Pid 1 pid 2... (5 Replies)
Discussion started by: mohamedirfan
5 Replies

3. UNIX for Dummies Questions & Answers

Identify issues through logging in unix

I am a newbie to unix and appeared for an interview and was asked this question. If i was working for a company as a support person on an application and has to monitor the logs how would i determine if there was outage by checking the logs and where would i search for the issue initially. and... (2 Replies)
Discussion started by: praveenveerla
2 Replies

4. Programming

Unix system crashing - Need help to identify the issue

Hi, We are accessing our remote webserver using libcurl.We are using GET method to post the request.The request is a simplified URL.We will receive XML Response for the URL request. Problem For Few Scenarios, response for the URL request is received & our component is killed abruptly. Can... (11 Replies)
Discussion started by: banus
11 Replies

5. UNIX for Dummies Questions & Answers

identify a customer under a UNIX server

Like many UNIX users, there is a small team that is connected to UNIX (under the same UNIX user) via putty from a Windows PC. Is there a way, once under UNIX, to know the address of the originating computer or anything that can differentiate initial users ? (7 Replies)
Discussion started by: popescu1954
7 Replies

6. Shell Programming and Scripting

how to identify the mode of the file in unix

hi, I have a requirement in that i need to process a input file The problem is, the input file sometimes it is coming in dos mode and some times it is coming in unix mode The script which i have written will process the file only if it is in unix mode and it is not processing if the file is in... (7 Replies)
Discussion started by: trichyselva
7 Replies

7. UNIX for Advanced & Expert Users

identify the unix process performing high disk i/o reads and writes

Guys, Is there any UNIX command that captures the 'Unix process which is performing high disk I/O reads and writes'. can you help me in this? -Swamy (6 Replies)
Discussion started by: avsswamy
6 Replies

8. UNIX for Dummies Questions & Answers

code to identify the New Quarter

I am a sql programmer, I don't know much about UNIX. I want to modify the existing unix script ----------------------------------------------------------------- ............ cd /home/location/file set timing on sqlplus user/$IDPW <<! prompt RUNNING NEW QUARTER PROCESSING. PLEASE WAIT.... (1 Reply)
Discussion started by: stefani
1 Replies

9. Shell Programming and Scripting

Identify records having junk characters in unix

Hi Friends, I need to have a command in Unix which output all teh records havingg junk characters in a file.... I know a command cat -tv <Filename> which opens the file and we can check for any junk character in it. But my requirement is to fetch ONLY THOSE records having junk characters.... (6 Replies)
Discussion started by: sureshg_sampat
6 Replies

10. UNIX for Advanced & Expert Users

Identify a remote machine as windows or unix

Hi, I have a IP address of the target machine.Is there is any way to find out whether it is a unix box or windows box without logging into it?. Regs Anand (5 Replies)
Discussion started by: u449064
5 Replies
Login or Register to Ask a Question