Solved

ksh with a.... #include

Posted on 2006-11-14
7
1,496 Views
Last Modified: 2013-12-20
Came across a ksh script that has these two lines right near the top.

#include <string.h>
#include <stdio.h>

Is there any reason why these should be there,  or are they just
artifacts from a previous c time?

Thanks

0
Comment
Question by:hank1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 11

Expert Comment

by:cjjclifford
ID: 17939280
In KSH these are just being seen as comments (the "#" is a comment-delimiter).

If this is truely a KSH script then these are meaningless... However, are you sure this is indeed a KSH script?
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 125 total points
ID: 17939753
Those 2 lines are what u typically include in a C program, u do not add anything like that in a shell script.
so your suspicions are correct, its artifacts from a previous C time.

Does this script of yours contain anything like

main()

or

printf

or some other C type calls?
Does it contain any comments that start with

/*

or

//

0
 
LVL 48

Expert Comment

by:Tintin
ID: 17941770
How did you determine it was a ksh script?
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 11

Expert Comment

by:cjjclifford
ID: 17945445
If you're on a Unix system, what is the output of "file scriptname" (assuming "scriptname" is the name of the file in question). What Unix are you on (if Unix that is...)
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17960316
> Is there any reason why these should be there,  or are they just artifacts from a previous c time?
if it is really a ksh script (meaning korn shell script), possible answers are:
  yes (if your meant "why are they there", ask the author)
  no   (if you meant if they are executed by ksh)
0
 
LVL 1

Author Comment

by:hank1
ID: 17986718
tintin - named 'sdfsdfs.ksh' in a bin directory full of them.  I suppose it could have been another shell.
ahoffmann - author long gone.
cjjclifford  - file output = shell script  - ksh (Korn shell)
Thanks all.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17987952
does this mean that your file actually was C code and not ksh script
0

Featured Post

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question