Sponsored Content
Top Forums Shell Programming and Scripting Error while using sqlplus command inside 'if' condition in an unix shell script Post 302467602 by Scott on Saturday 30th of October 2010 07:33:03 AM
Old 10-30-2010
EOF should also be at the very start of the line

Code:
...
EOF
)

(it only became obvious that it was not at the start after adding code tags!)

There is no difference between = and == in this context.

And if choice is a number, you should treat it as such:

Code:
if [ "$choice" -eq 1 ];
  ...

The extra ; after fi is harmless enough.

Last edited by Scott; 10-30-2010 at 08:44 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

help me in sending parameters from sqlplus script to unix shell script

Can anybody help me out in sending parameters from sql*plus script to unix shell script without using flat files.. Initially in a shell script i will call sql*plus and after getting some value from some tables, i want that variable value in unix shell script. How can i do this? Please tell me... (2 Replies)
Discussion started by: Hara
2 Replies

2. Shell Programming and Scripting

(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script

Hi, I need help urgently for following issue. Pls help me to resolve this issue. I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql) I given... (6 Replies)
Discussion started by: praka
6 Replies

3. UNIX for Dummies Questions & Answers

calling a unix shell script from sqlplus

I want to execute a shell script from sqlplus prompt and get its output back to sqlplus. Is this possible? if yes just give me an example for doing that. (2 Replies)
Discussion started by: boopathyvasagam
2 Replies

4. Shell Programming and Scripting

how to use sqlplus command inside for loop

I tried this: for region in 'raj' 'kt' 'kol' 'krl' 'chn' 'dl' 'hr' 'bih' 'ap' do sqlplus -s huw$region/`echo $region`huw#321@huw$region<<! set serveroutput on begin select count(*) from tcd_preferred_cust_201109 end; / exit; done but the error shows like: Syntax error at line 4 :... (1 Reply)
Discussion started by: deepakprasad29@
1 Replies

5. Shell Programming and Scripting

how to use split command in unix shell with a condition

Hi all, I have a file which I want to split into several files based on a condition. This files has several records. I want one record per file. Each record ends with a //. So, I want to separate files based on this condition. I want split files to be named with the name across the field ID (for... (2 Replies)
Discussion started by: kaav06
2 Replies

6. Solaris

Error during running sqlplus command from shell script in Solaris

I am using following code to connect to oracle database from solaris shell script. which will try thrice to connect the database ...at the 4rth atempt it will exir=t. count=0 while ; do sqlplus -s $usrname/$password@dbSID <<-EOF | tee $logfile WHENEVER OSERROR EXIT 9; WHENEVER SQLERROR... (4 Replies)
Discussion started by: millan
4 Replies

7. Shell Programming and Scripting

If else condition inside for loop of awk command in UNIX shell scripting

Hi , Please excuse me for opening a new thread i am unable to find out the syntax error in my if else condition inside for loop in awk command , my actual aim is to print formatted html td tag when if condition (True) having string as "failed", could anyone please advise what is the right... (2 Replies)
Discussion started by: karthikram
2 Replies

8. Shell Programming and Scripting

Sqlplus inside shell script writing to tmp file

Hi, facing an issue while calling sqlplus inside shell script. It for some reason goes to tmp file to write something and i get error as permission denied as i dont have access there. ANy idea why sqlplus writes in /tmp and how to change or stop this ? (2 Replies)
Discussion started by: rushikeshs
2 Replies

9. Shell Programming and Scripting

Control not returning from Sqlplus to calling UNIX shell script.

Hello All, I have exactly same issue @vikas_trl had in following link: https://www.unix.com/shell-programming-and-scripting/259854-control-not-returning-sqlplus-calling-unix-shell-script.html I wonder if he or somebody else could find the issue's cause or the solution. Any help would... (4 Replies)
Discussion started by: RicardoQ
4 Replies

10. Shell Programming and Scripting

Need Multiple checks inside if condition in a bash shell script

Hi, I need to perform the untar and rm operation if the file found is a .tar and does not have test.tar or hello.tar as the file names. Below is the loop to check the same. for tf in *.tar do if ] then found=1 ... (1 Reply)
Discussion started by: mohtashims
1 Replies
BEEF(1) 							   User Commands							   BEEF(1)

NAME
beef - flexible Brainfuck interpreter SYNOPSIS
beef [OPTIONS] FILE DESCRIPTION
beef is a Brainfuck interpreter written in C. It is written with flexibility and portability in mind: it is not the smallest nor the fastest Brainfuck interpreter on Earth, but it has some options to control his behavior and doesn't suffer most of the limitations which are usually present in Brainfuck interpreters. One of the best features of beef is that it has no limitations on the length of the tape, which is created dinamically, and allows you to move in any direction, even to move an unlimited amount of cells left when you are on the starting cell. beef also allows you to control his behavior in case it reads and EOF from the input stream: see below for a list of available options. OPTIONS
-d Enable debugging. The debugging command # is not part of the Brainfuck language, but it's an useful feature for the programmer, so most interpreters implement it. Debugging is off by default. -e When read an EOF from input, store an EOF in the current cell. This is for compatibility with programs written for other inter- preters; the default behavior is to store a 0 in the current cell when an EOF is read. -n When read an EOF from input, do nothing. This is the default behavior in some other interpreters, so it's supported in beef for com- patibility reasons. The default behavior is to store a 0 on the current cell instead. --version Show the version number and exit successfully. --help Show a short help message and exit with success. EXIT STATUS
beef returns an exit staus of zero on success, or an exit status of -1 if it was unable to perform the requested operation. Please note that no checks are performed on the code: if the code you are trying to run is buggy, beef will run it anyway and the result will probably differ from what you expected. AUTHOR
This manual page was written by KiyuKo <eof AT kiyuko DOT org> 0.0.6 February 01, 2007 BEEF(1)
All times are GMT -4. The time now is 10:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy