Solved

ksh with a.... #include

Posted on 2006-11-14
7
1,475 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
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
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

772 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