LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-06-2009, 02:03 PM   #1
ShaqDiesel
Member
 
Registered: Jul 2005
Posts: 144

Rep: Reputation: 15
Redirection question


If I have
print "sqlplus "\'"/ as user"\'" <<EOF" >> file1
print "@dbscript" >> file1
print "EOF" >> file1

Why would unix actually login to sqlplus and execute dbscript instead of just printing "sqlplus "\'"/ as user"\'"? Can someone explain the order of the redirection in the above sample? Thanks.
 
Old 01-06-2009, 02:33 PM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,508

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
Which shell are you using? It works if you use echo instead of print? The resulting output should be
Code:
sqlplus '/ as user' <<EOF
@dbscript
EOF
Is this what do you want to achieve?
 
Old 01-06-2009, 05:30 PM   #3
ShaqDiesel
Member
 
Registered: Jul 2005
Posts: 144

Original Poster
Rep: Reputation: 15
That is what it is doing(get rid of the EOF in the code you posted). I want to know why dbscript gets executed. I am using ksh.
 
Old 01-06-2009, 05:41 PM   #4
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,508

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
It works on my system, with ksh-93t. I don't see anything strange in your code. The print statement and the quoting should prevent the shell to execute anything. What is the output of the following command?
Code:
type print
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question in process redirection syfung Programming 1 09-20-2008 06:56 PM
question about input output redirection in c haydari Programming 3 04-16-2007 07:52 AM
redirection in C pantera Programming 2 08-11-2004 01:06 PM
Apache redirection question... WeNdeL Linux - Software 2 04-01-2004 10:48 AM
Redirection question... Zeracles *BSD 0 02-21-2004 11:11 AM


All times are GMT -5. The time now is 04:50 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration