shellscript problem


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users shellscript problem
# 1  
Old 09-06-2007
shellscript problem

hI,
Pls consider the following shell script

#!/bin/csh -f

sqlplus tkyte/tkyte <<"EOF" > tmp.csh
set serveroutput on
declare
a number:=5;
begin
dbms_output.put_line( 'a:='||a );
end;
/
spool off
"EOF"

The above script does the followin
1)it connects to oracle.
2)It reads the simple pl/sql programming till "EOF" and puts that code in a file called tmp.csh
But when i execute the above script ,The pl/sql code is not getting transfered into the specified file.
If any thing is wrong in the above script pls correct me.

cheers
RRK
# 2  
Old 09-07-2007
Try below code

#!/bin/csh -f

sqlplus tkyte/tkyte << "EOF"
set serveroutput on
declare
a number:=5;
begin
dbms_output.put_line( 'a:='||a );
end;
/
spool off
"EOF" >> tmp.csh 2>&1
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk in shellscript

Dear Members, I have the following situation I do not understand: I have a large json encoded file which I need to grep and afterwards want to extract specific information. I use this command to to that: cat /tmp/file | awk -F '"fields":' '{print $2}' | awk -F '"description":' '{print $4}'... (6 Replies)
Discussion started by: crumble
6 Replies

2. Shell Programming and Scripting

Execution problem with the FTP shellscript

Hi Friends I am new to the shell script and i have a script which will connect to server enviornment which will read a file and will FTP to an another server location. But while executing this script FTP transfer is not occuring. But when I enter in FTP mode I am able to transfer the file... (5 Replies)
Discussion started by: Kannannair
5 Replies

3. Shell Programming and Scripting

Help with shellscript

I am new in shell script i want to convert .txt file in the format axsjdijdjjdk to a x s j d i j d j j d k (5 Replies)
Discussion started by: sreejithalokkan
5 Replies

4. Shell Programming and Scripting

if condition in shellscript

Hi All, I tried below code getting error. AD=0 ZERO=0 if then echo "AD is zero select another symbol" fi syntax error near unexpected token `fi' plz help me to solve this error (4 Replies)
Discussion started by: aish11
4 Replies

5. Shell Programming and Scripting

Automation of UI using shellscript

Hi, I want to do automation on UI using shellscript. eg: 1) Drop down menu contains assign , investigate, closed. now there is one id want assign it using assign tab then need to investigate it and lastly close. Sometimes the id can't assign to perticular user. there are so many... (11 Replies)
Discussion started by: aish11
11 Replies

6. Shell Programming and Scripting

sed Problem in Shellscript

Hi, i have a problem with sed i want to substitude a / to ",""," in the following pattern: number/number so if u have a file which contains -> "Streetname 9/8/6" it shouldn't substitude anything, only if it is "Streetname 9/6" to "Streetname 9","","6". Maybe you can help me, i try so many... (5 Replies)
Discussion started by: urukai
5 Replies

7. Shell Programming and Scripting

Need help with shellscript

Hello. I am a novince at writing shell scripts but here is the question. I have to write a shell script that does the following: Once executed via crontab, the script should do the following: a. get date/time stamp in for format 10-MAR-05 and b. execute shell script my_script.sh (which... (2 Replies)
Discussion started by: jigarlakhani
2 Replies

8. Shell Programming and Scripting

Create Shellscript

I am new to UNIX. I got the file from Oracle, with two columns (Table Name and Column Name). I need to create the shell script where the result suppose to include plain text, <table_name>, <Column_name> from the file. Plain text will be the statements to create index in Oracle. something like... (1 Reply)
Discussion started by: newuser100
1 Replies
Login or Register to Ask a Question