LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-30-2008, 01:38 AM   #1
dmauas
LQ Newbie
 
Registered: Dec 2008
Posts: 2

Rep: Reputation: 0
Question Language of the file: /etc/rc.d/rc on CentOS 5 Linux v2.6.18-92.1.22.el5


Hi all
Before posting this thread I have attempted a web search and a forum search to find any relevant info, yet I have found no relevant info.

I have opened the file /etc/rc.d/rc in vim and am having trouble understanding it: It's not C, it's not perl, and its hard to find information about the programming language used in this file - my question is quite simply:

What language is this file written in?
(please note that I referring specifically to the file /etc/rc.d/rc and not any other rc* or rc.* file)

Thanks a lot,
dmauas

Last edited by dmauas; 12-30-2008 at 01:43 AM.
 
Old 12-30-2008, 01:44 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Looks like a bash script to me
 
Old 12-30-2008, 01:48 AM   #3
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Sorry - just did a quick cat

First line confirms it

Code:
#! /bin/bash
#
# rc            This file is responsible for starting/stopping
#               services when the runlevel change
 
Old 12-30-2008, 01:59 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
In addition, when the so called sha-bang is present in the very first line of the script, the file command tells you about the type of script/program:
Code:
$ file /etc/rc.d/rc
/etc/rc.d/rc: Bourne-Again shell script text executable
Basically on a Linux system you will find two types of executable files: shell scripts, being /bin/bash the native shell in Linux, and ELF executables. For example
Code:
$ file /usr/bin/file
/usr/bin/file: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
These are the compiled C/C++ programs. The source of these programs are not available by default on your system, unless you explicitly install the source packages (for example if you want to rebuild a package or re-compile a code using specific options).

Nevertheless you can find other types of scripts, basically written in Perl or Python. At a first glance the file command can reveal their nature.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to scan file in C language shifter Programming 9 10-03-2008 11:28 AM
Language defualt file phantom_cyph Linux - General 1 05-07-2007 08:41 PM
get size of certain file using c language? nesta Programming 3 04-05-2007 06:17 AM
Question on Grub language Denny711 Linux - Newbie 2 07-17-2005 12:42 AM
language question? gexiaofei Linux - Newbie 1 08-03-2003 03:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration