Sponsored Content
Full Discussion: how to include code
Top Forums Shell Programming and Scripting how to include code Post 302141303 by ihot on Thursday 18th of October 2007 02:04:19 PM
Old 10-18-2007
how to include code

Hi,
I have an easy question...
My ksh script has a section with non ksh script in it - let's pretent it is VBA code. I need to include this vba script in my ksh script into so that my VBA script can be reused elsewhere by other ksh script by "$include" into other ksh scripts. What is the syntax - do you know? .

For example, instead of this original ksh script:

#!/bin/ksh

run VBA script
import database dimensions
from local text data_file 'sales_hierarchy.txt' using server rules_file 'sales2'
on error append to '.log';
end of run VBA script
exit

I want to break it into two. The first script:

#!/bin/ksh

$include vba.code

exit

my vba.code will have the VBA section:
run VBA script
import database dimensions
from local text data_file 'sales_hierarchy.txt' using server rules_file 'sales2'
on error append to '.log';
end of run VBA script
Thanks in advance
Smilie

Last edited by ihot; 10-18-2007 at 04:21 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

#include?

I have a file that contains some variables that I may want to share throughout multiple scripts. I think there's an #include command in UNIX. How do I use it (in korn)? (1 Reply)
Discussion started by: yongho
1 Replies

2. Programming

About $include

Hi, In my code,I come across include statements with $ sign what it represents... $include "getsum.h" /* This how I seen in my code */ Sarwan (5 Replies)
Discussion started by: sarwan
5 Replies

3. UNIX for Advanced & Expert Users

dhcp include

I want to include all the subnet files under /etc/dhcpd/ to /etc/dhcpd.conf so here is my content of dhcpd.conf ... include "/etc/dhcpd/*"; however, the check-syntax reports syntax error, as they do not recognize the wildcard *, and display that " file /etc/dhcpd/* could not be found. ... (1 Reply)
Discussion started by: fredao
1 Replies

4. Programming

Include directive

Hi there, I'm working on a c++ project and I need to use some libraries which are part of a framework. I installed it on my home directory, and alle the .hh are located in subdirs of my home. I'd like to include the files I need just as if they where std c header, that is: #include... (2 Replies)
Discussion started by: clalfa
2 Replies

5. Shell Programming and Scripting

scripting help: to include r in between / :

Hi Experts, Greetings! , I have a list of lvs that is having 3 column separated by / . Want to add "r" after the 3rd / : /dev/vgdbnhpu/u01 /dev/vgdbnhpu/u02 /dev/vgdbnhpu/u03 /dev/vgdbnhpu/u04 /dev/vgdbnhpu/u05 /dev/vgdbnhpu/u06 /dev/vgdbnhpu/u07 /dev/vgdbnhpu/u08... (4 Replies)
Discussion started by: rveri
4 Replies

6. Shell Programming and Scripting

perl file, one line code include "length, rindex, substr", slow

Hi Everyone, # cat a.txt a;b;c;64O a;b;c;d;ee;f # cat a.pl #!/usr/bin/perl use strict; use warnings; my $tmp3 = ",,a,,b,,c,,d,,e,,f,,"; open(my $FA, "a.txt") or die "$!"; while(<$FA>) { chomp; my @tmp=split(/\;/, $_); if ( ($tmp =~ m/^(64O)/i) || ($tmp... (3 Replies)
Discussion started by: jimmy_y
3 Replies

7. Programming

help with C #include

i have three files a.h t.c and p.c a.h has 3 functions only and does not include anything p.c has one function i made called go t.c has a main function and calls the go function, it includes a.h only i run the program using gcc -Wall -g -o t p.c t.c but i get a warning, implicet... (2 Replies)
Discussion started by: omega666
2 Replies

8. Solaris

include files

Our admin has upgraded our OS solaris system to 5.11 but no more I can compile any trivial or non-trivial code. I'm trying to compile a trivial c++ program(a Helloworld program) but It gives error indicating that include files do not exist (in this trivial case <stdio.h>), it starts compiling but... (1 Reply)
Discussion started by: Newsha
1 Replies

9. Programming

Problem with include

I have been playing with some classes and am getting the following error baseLib/lininterp.h:182: error: expected class-name before ‘{’ token baseLib/lininterp.h:227: error: expected class-name before ‘{’ token baseLib/lininterp.h:269: error: expected class-name before ‘{’ token... (0 Replies)
Discussion started by: kristinu
0 Replies

10. Red Hat

%include in kickstart

RHEL 5.4 I'm trying to use %include statements in my kickstarts, and am running into some problems. In %pre, I can %include /mnt/source/isolinux/setup-questions and that works just fine. One of the things it does is echo out several variables to /tmp/vars In %post --nochroot, I copy... (2 Replies)
Discussion started by: jnojr
2 Replies
exit(1) 							   User Commands							   exit(1)

NAME
exit, return, goto - shell built-in functions to enable the execution of the shell to advance beyond its sequence of steps SYNOPSIS
sh exit [n] return [n] csh exit [ ( expr )] goto label ksh *exit [n] *return [n] DESCRIPTION
sh exit will cause the calling shell or shell script to exit with the exit status specified by n. If n is omitted the exit status is that of the last command executed (an EOF will also cause the shell to exit.) return causes a function to exit with the return value specified by n. If n is omitted, the return status is that of the last command exe- cuted. csh exit will cause the calling shell or shell script to exit, either with the value of the status variable or with the value specified by the expression expr. The goto built-in uses a specified label as a search string amongst commands. The shell rewinds its input as much as possible and searches for a line of the form label: possibly preceded by space or tab characters. Execution continues after the indicated line. It is an error to jump to a label that occurs between a while or for built-in command and its corresponding end. ksh exit will cause the calling shell or shell script to exit with the exit status specified by n. The value will be the least significant 8 bits of the specified status. If n is omitted then the exit status is that of the last command executed. When exit occurs when executing a trap, the last command refers to the command that executed before the trap was invoked. An end-of-file will also cause the shell to exit except for a shell which has the ignoreeof option (See set below) turned on. return causes a shell function or '.' script to return to the invoking script with the return status specified by n. The value will be the least significant 8 bits of the specified status. If n is omitted then the return status is that of the last command executed. If return is invoked while not in a function or a '.' script, then it is the same as an exit. On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways: 1. Variable assignment lists preceding the command remain in effect when the command completes. 2. I/O redirections are processed after variable assignments. 3. Errors cause a script that contains them to abort. 4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari- able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not performed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
break(1), csh(1), ksh(1), sh(1), attributes(5) SunOS 5.10 15 Apr 1994 exit(1)
All times are GMT -4. The time now is 02:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy