Can you include one ksh script into another?

Posted on 2005-03-17
Medium Priority
Last Modified: 2013-12-26
Can you include one ksh script into another? What is the syntax?
Question by:rayskelton
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

Assisted Solution

koppcha earned 240 total points
ID: 13569731
include in the sense .Do you want to call one KSH script from another
then make the other ksh script which you want to call as executable and then just give the path of it in the first ksh script.
by doing this you can also pass paramters to the second kornshell script.In the second korn shell script you can access it like $1,$2...so on.
Let me nkow if this is what you are looking for..if not let me know why you want to include?i mean what you are trying to do?
LVL 48

Accepted Solution

Tintin earned 260 total points
ID: 13569798
. /path/to/other/script.ksh

Expert Comment

ID: 13571953
if it  has run permissions
 jsut enter the script  filename in the script you want to run it from.



Technology Partners: 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 51

Expert Comment

ID: 13572711
"include" does not work for shells, the nearest aproach to mimic this is what Tintin suggested http:#13569798

Author Comment

ID: 13573720
I was looking for something like a preprocessor macor in C, or C++. I have a large(2000 line) ksh script, which contains configuration information at the beginning of the script and maintained by support staff. It would be nice to pull out this header info from the main script and put in a configuration script, which would be included into the main script. The option of putting in a seperate executable file and running this file looks to be my only option.
LVL 51

Expert Comment

ID: 13573751
are these "configuration parts" ksh commands?
then simply store in new file and  http:#13569798

Author Comment

ID: 13573792
Yes ksh

Author Comment

ID: 13573807
Thanks for all info

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

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.
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.
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:
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses

764 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