Correct me to run a sh file in ksh shell!


 
Thread Tools Search this Thread
Operating Systems Solaris Correct me to run a sh file in ksh shell!
# 1  
Old 06-06-2008
Correct me to run a sh file in ksh shell!

Hi all!
I wrote a file named as rman_backup.sh, and this is contents
Code:
#!/bin/ksh
ORACLE_SID=VNP;export ORACLE_SID
echo $ORACLE_SID

echo "Please Specify the kind of backup you want to take"
echo "1) LEVEL 0 VNP"
echo "2) LEVEL 1 VNP"
echo "3) EXPORT BACKUP"
echo "Enter your option"

read option

while [ $option -gt 3 ]||[ $option -le 0 ]

do
echo "Please Enter the correct option"

read option

done

case $option in
1) echo "You are taking rman backup of DB Level 0"
   rman target sys/neovnp@vnp @/vnporadataSYSTEM/backupIncrementalVNP/Level0VNP.rc;
   exit;;
2) echo "You are taking rman backup of DB Level 1"
   rman target sys/neovnp@vnp @/vnporadataSYSTEM/backupIncrementalVNP/Level1VNP.rc;
   exit;;
3) echo "You are taking export backup of DB" 
   exp ccs_admin/codeccb@vnp file=/vnprctl/exp_ccs_admin.dmp log=/vnprctl/exp_ccs_admin.log;
   exit;;
esac

exit

But when I executed, I received the message:
can not execute
Were I wrong?

And I searched in google days by days, but I did not make it run automaticaly at 8:00pm daily. Would you like to guide me?

Thank you very much!
# 2  
Old 06-06-2008
Did you check the permissions to the script. Hope you have not left out with the executable access to the same.

Thanks!
# 3  
Old 06-06-2008
re:Correct me to run a sh file in ksh shell!

I would suggest that you check if /bin/ksh exists on your system and you have permissions to execute it as the user running the script. If the script was not +x then the error would be "permission denied" or something.
# 4  
Old 06-07-2008
Quote:
Originally Posted by ra1ne
I would suggest that you check if /bin/ksh exists on your system and you have permissions to execute it as the user running the script. If the script was not +x then the error would be "permission denied" or something.
Thank you for your replies!
But I am Solaris's newbie Smilie
Would you like to guide me how to grant role to oracle user can execute this script?
The oracle user had been granted by root using ksh - korn shell default!

Thanks so much!
# 5  
Old 06-10-2008
You should first alter file ownership to user oracle using chown then change the permission using chmod
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies

2. Shell Programming and Scripting

Auto correct a csv file using UNIX shell script.

Hi All, There are list of 4-5 .csv files which has 12 columns.In some cases one of the record is split into 2 records. What needs to be done is this split record has to be auto corrected and placed in the csv file. Eg: Let us consider sample.csv file and in normal conditions the file would... (40 Replies)
Discussion started by: karthik_ak
40 Replies

3. UNIX for Dummies Questions & Answers

To run ksh script via autosys job without asking password for file transfer

I've K shell script. It will transfer the files from one server to other server using 'SCP' command. While running the script alone as a command line in UNIX ssh terminal its running with out asking password and files are transferred with out asking for password. But by running the script using... (6 Replies)
Discussion started by: maheshbabu
6 Replies

4. Post Here to Contact Site Administrators and Moderators

Auto correct a csv file using UNIX shell script.

Hi All, There are list of 4-5 .csv files which has 12 columns.In some cases one of the record is split into 2 records. What needs to be done is this split record has to be auto corrected and placed in the csv file. Eg: Let us consider sample.csv file and in normal conditions the file... (1 Reply)
Discussion started by: karthik_ak
1 Replies

5. Shell Programming and Scripting

How to run ksh script in bash shell?

Hi All, I have few bash shell scripts which depends on one Ksh shell script. When i run bash shell scripts, it shows error as bad interpretor : ksh no such bad file or directory. When i tried to install ksh shell, it is not downloading too. If I remove !/bin/ksh command in starting line of the... (14 Replies)
Discussion started by: Karthik03
14 Replies

6. UNIX for Dummies Questions & Answers

Getting correct path to run appropriate script

I have tcsh scripts on path /home/chrisd/tatsh/trunk/hstmy/bin/tcsh/ I want to run the script from within another script. Suppose I go to directory /home/chrisd/tatsh/trunk/hsdata/n02/terr0.25/darwin and want to run checksrdist.tcsh So I do cd ... (1 Reply)
Discussion started by: kristinu
1 Replies

7. 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

8. Shell Programming and Scripting

Making a KSH exit if path is not correct

I am very green to shell programming and have no training and this is my first real attempt. I am fairly versed in Unix and running the cmds I need. I tried using the search feature but most of what I found was close but not quite what I am looking for, plus most looked more advanced than I... (7 Replies)
Discussion started by: htown71
7 Replies

9. Shell Programming and Scripting

Shell script run error ksh: not found

Hi All, I am trying to run a script to FTP files from one UNIX server to another UNIX server. Actually I can able to FTP file successfully by manually or paste whole script at prompt. But when I am trying to run script it is giving error. Please let me know the cause. #!/bin/sh... (3 Replies)
Discussion started by: nz80qy
3 Replies

10. UNIX for Dummies Questions & Answers

Why can't I run a *.ksh file?

Hi I'm interested to know why is it that I can't run a specific *.ksh file, is it due to permission settings? If it is, how can I work around that? I'm not logging on as the administrator, do I need to be an administrator to run *.ksh files? (5 Replies)
Discussion started by: handynas
5 Replies
Login or Register to Ask a Question