Korn Shell Script help required during execution...


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Korn Shell Script help required during execution...
# 1  
Old 07-21-2008
Korn Shell Script help required during execution...

Hi,

The following Korne Shell script does not give any syntax errors but the following while running. Request you to please let me know, how can I define the variables viz.:- listDbs and getkey here, inorder to remove the error.

1)
$ ksh -n setAlias

$


2)
$ ksh -x setAlias
+ typeset -l j
+ listDbs -g
setAlias[27]: listDbs: not found
+ listDbs -a
setAlias[27]: listDbs: not found
+ getkey hosts unix
setAlias[34]: getkey: not found

--------------------------------------------------------------------------
setAlias
-------

#! / usr / bin / ksh
# ================================================= ===========================
# Version control: $ Id $
# Name: setalias
# Description: set default aliases
# Synopsis: setalias
# Exports:
# Calls: getkey
# ================================================= ===========================
# Note:
# ================================================= ===========================
# Version:
# Author:
# Change:
# ================================================= ===========================

# Instances
typeset -l j

for j in `listDbs -g ; listDbs -a`
do
alias -x $j=". setOraEnv $j"
done

# Hosts

for i in $(getkey $ENVFILE hosts unix)
do
alias -x $i="rlogin $i"
done

--------------------------------------------------------------------------

Regards,
Marconi.
# 2  
Old 07-21-2008
The problem is: where does the listDBs executable or shell script live?

use /usr/bin/listDBs or /home/mydirectory/listDBs or whatever is needed to locate the file.

PS: no spaces in this
Code:
#! / usr / bin / ksh 
# should be
#!/usr/bin/ksh

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

[Solved] Korn Shell execution

There are two Korn Shell scripts : script_1.ksh ( located in /home/dir1 ) script_2.ksh ( located in /home/dir2 ) Content of script_2.ksh is #!/usr/bin/ksh echo "Hello world.." The script_2.ksh is called from within script_1.ksh using the following command : ./home/dir2/script_2.ksh but... (7 Replies)
Discussion started by: kumarjt
7 Replies

2. Shell Programming and Scripting

Korn shell script required

Want a Korn shell script which reads the records in a file and at a specific position it is to be checked whether tht is blank. eg- dhgadjhkwdkwyuywu< blank spaces for 8 chrs >gdwyduyweeduy xvgjdwtdjtwktdtwtdt< blank spaces for 8 chrs >udedeiueduuedu suppose tht one line in file is of 100... (4 Replies)
Discussion started by: Juhi Kashyap
4 Replies

3. Shell Programming and Scripting

pass null value to sql script from korn shell script

There are 4 parameters that I have to pass from korn shell to sql script. 1) I have to check if $1 , $2 , $3 and $4 are null values or not . How can I do that ? 2) Once its determined that these values are null (in the sense they are empty) how can I pass null values to sql script... (11 Replies)
Discussion started by: megha2525
11 Replies

4. Homework & Coursework Questions

Korn Shell Script

1. The problem statement, all variables and given/known data: Write a korn shell script with an alfanumeric string as argument. The script lists the file's names in the current directory that contain the given string as substring and that can be read and written. 2. Relevant commands, code,... (3 Replies)
Discussion started by: burm
3 Replies

5. Shell Programming and Scripting

Korn Shell Script

I have to solve some exercises in Korn Shell, but i'm having some problems. For example: Write a korn shell script with an alfanumeric string as argument. The script lists the file's names in the current directory that contain the given string as substring and that can be read and written. I... (3 Replies)
Discussion started by: burm
3 Replies

6. UNIX for Dummies Questions & Answers

running script with korn shell

How would i instruct the current shell to run the current script using the korn shell? (1 Reply)
Discussion started by: JamieMurry
1 Replies

7. Shell Programming and Scripting

Korn Shell script needed

Hi all, I need a Korn Shell script that will go out to all Unix Servers and pull all non humans IDs from them while at the same time produce a file to show which servers we have access to and which ones we don't. Thanks in advance. (5 Replies)
Discussion started by: vinsara
5 Replies

8. AIX

Help with Korn Shell script

I have this Korn shell script that runs via a cron entry. It runs in a loop "watching" a specific file system for files with a certain name. The file system that it is watching is an upload file system for an FTP server. When files that are the correct name come in, it takes the extension of the... (1 Reply)
Discussion started by: heprox
1 Replies

9. UNIX Desktop Questions & Answers

korn shell script

hi all i am writing the korn shell script. i have a SQL script which gives me the folowing output DSA.WLG.20050713211544.20051025.20050713211544 28991 1130198400 DSA.WLG.20050713211544.20051025.20050713211544 25881 1130198400 DSA.WLG.20050711210100.20051025.20050711210100 25881 ... (3 Replies)
Discussion started by: pavan_test
3 Replies

10. UNIX for Dummies Questions & Answers

korn shell script

hello., i have 2 files.. 1 file is in this folder /home/test/ssk/DSA.WLG.20050713211544.20050710.20050713211544 (this part) other file is in this folder /home/kk/dev/DSA.WLG.20050711210100.20050710.20050711210100 ... (1 Reply)
Discussion started by: pavan_test
1 Replies
Login or Register to Ask a Question