Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 455
  • Last Modified:

Can you include one ksh script into another?

Can you include one ksh script into another? What is the syntax?
0
rayskelton
Asked:
rayskelton
2 Solutions
 
koppchaCommented:
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?
0
 
TintinCommented:
#!/bin/ksh
. /path/to/other/script.ksh
0
 
mike_mianCommented:
if it  has run permissions
 jsut enter the script  filename in the script you want to run it from.

ie

 
#!/usr/bin/ksh


/path/to/other/script.ksh
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!

 
ahoffmannCommented:
"include" does not work for shells, the nearest aproach to mimic this is what Tintin suggested http:#13569798
0
 
rayskeltonAuthor Commented:
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.
0
 
ahoffmannCommented:
are these "configuration parts" ksh commands?
then simply store in new file and  http:#13569798
0
 
rayskeltonAuthor Commented:
Yes ksh
0
 
rayskeltonAuthor Commented:
Thanks for all info
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now