Solved

ksh with a.... #include

Posted on 2006-11-14
7
1,489 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
matchUp  challenge 9 125
Getting attribute Values using xslt 4 60
Microsoft Edge 9 106
Windows shortcut location resolution on double click open 4 53
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

733 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