Solved

ksh with a.... #include

Posted on 2006-11-14
7
1,495 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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 
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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

734 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