Ksh Associating scripts

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Ksh Associating scripts
# 1  
Old 09-05-2009
Ksh Associating scripts

Im writing a script in the Ksh, as the title suggests.

OK so im sincerely tring to be lazy. Im trying to make a script that will use another file as a sort of variable library

So basically i dont need to include the variables themselves, just want to make a reference to the file, so the shell will read it. understand the variables. And all i need to do is simply reference them

So as an example


Ksh Script

Echo "$A"
Echo "$B"
Echo "$C"

Is there an #Include File or something equivelant that will work?
# 2  
Old 09-05-2009
It is called sourcing a file. Assume the file whose variables you need is called var.sh
.  /path/to/var.sh

That is a dot followed by a space then the file specification
# 3  
Old 09-05-2009
ok so just for clarification The Green "S" will represent a "Space"


Did i understand correctly?

---------- Post updated at 05:09 AM ---------- Previous update was at 02:05 AM ----------

OK i got it! Cool thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh behavior in scripts spawned w/nohup

I have a need to run any number of identical scripts simultaneously, so I've created a driver script which reads a template script, edits these appropriately and then submits them via nohup. The spawned scripts all check to see at some point how many of their number are running and once the count... (7 Replies)
Discussion started by: safedba
7 Replies

2. Programming

ksh array updated by multiple scripts

Hello! Is it possible to update an array created in a ksh script by a child script that was spawned by the parent? So, if I have... #!/bin/ksh set -A myArray "Zero" "One" "Two" echo "0: ${myArray}" echo "1: ${myArray}" echo "2: ${myArray}" ./second_script.ksh ${myArray } echo... (2 Replies)
Discussion started by: garskoci
2 Replies

3. UNIX for Advanced & Expert Users

Running scripts without a hashbang - ksh anomaly?

I noticed some strange looking parameters on some processes on one of our servers, and after a little playing around we deduced that ksh seemed to be adding a (somewhat random) extra parameter when calling a script without a hashbang in it. It looks like it's the partial name of the parent... (10 Replies)
Discussion started by: CarloM
10 Replies

4. Shell Programming and Scripting

Restrict access to .ksh scripts

Hi, How to restrict access to a .ksh script in such the way that the users can only execute the script, neither read nor write. I tried the below code so that my user alone has the rwx and other users can only execute. chmod 711 sample.ksh But when I logged in as a different user... (26 Replies)
Discussion started by: machomaddy
26 Replies

5. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

6. Shell Programming and Scripting

KSH script to run other ksh scripts and output it to a file and/or email

Hi I am new to this Scripting process and would like to know How can i write a ksh script that will call other ksh scripts and write the output to a file and/or email. For example ------- Script ABC ------- a.ksh b.ksh c.ksh I need to call all three scripts execute them and... (2 Replies)
Discussion started by: pacifican
2 Replies

7. Shell Programming and Scripting

converting ksh scripts to sh

Hello All, I have a whole bunch of shell scripts written in a ksh environment and which successfully execute there. However, I found out that they eventually need to be used in a sh environment. So some commands like some_variable=$(some_command) fail because sh doesn't understand $(.....). I... (11 Replies)
Discussion started by: sherkaner
11 Replies

8. UNIX for Dummies Questions & Answers

re-associating 2 HP UNIX servers

Hello, i am new to both this forum and UNIX as well; i am working at a local cancer center trying to reassociate 2 UNIX server systems that i am unfamiliar with; Both C3600 workstations were associated, however they were disassociated and need to be reassociated so programs can be accessed on... (0 Replies)
Discussion started by: RarisRSX
0 Replies

9. Windows & DOS: Issues & Discussions

converting ksh scripts--.bat in window's

hi evry one , I did some ksh scripts for file editing in AIX 5.2 ver, issue is while I was trying to run these scripts in windows box as batch files windows is not recognising the awk part of the ksh script,as it is GNU environment, so any one who can help me will be appreciated. this is the... (3 Replies)
Discussion started by: 2.5lt V8
3 Replies

10. Shell Programming and Scripting

executing variables in ksh scripts?

In a ksh script on an AIX box running a jillion oracle database processes, I'm setting a variable to one of two possible arguments, depending on cmd line arguments. FINDIT="ps -ef | grep oracle | grep DBexport | grep rshrc" -or- FINDIT="ps -ef | grep oracle | grep prod | grep runback" I... (3 Replies)
Discussion started by: zedmelon
3 Replies
Login or Register to Ask a Question