The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-19-2005
bestbuyernc bestbuyernc is offline
Registered User
  
 

Join Date: Jul 2005
Posts: 18
RSH question

Is there a way to do an rsh from within a script and spans commands on multiple lines?

Ex.
Code:
rsh $host <<EOF
echo `hostname`
EOF
I get this error:
tcgetattr: Inappropriate ioctl for device
ioctl I_FIND ttcompat: Inappropriate ioctl for device
./t.script: EOF: command not found

At my old job we could do sql queries like this on KSH
Code:
var=`sqlplus -s <<-EOF
"query statement"
exit;
EOF`
I was wondering if I could do this with rsh. I am using a bash shell. Thanks.

Last edited by bestbuyernc; 07-19-2005 at 07:51 PM..
  #2 (permalink)  
Old 07-19-2005
reborg's Avatar
reborg reborg is online now Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,236
as an example:

Code:
rsh $host 'sqlplus -s <<EOF
"query statement"
exit;
EOF'
  #3 (permalink)  
Old 07-19-2005
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
The rsh command cannot be redirected input. rsh can only execute commands on remote systems.
The sqlplus command given by reborg will work as the sqlplus can take input from the terminal.
  #4 (permalink)  
Old 01-24-2007
sars sars is offline
Registered User
  
 

Join Date: Oct 2006
Posts: 19
rsh and sql

Quote:
Originally Posted by reborg
as an example:

Code:
rsh $host 'sqlplus -s <<EOF
"query statement"
exit;
EOF'
Hi reborg ..
a similar code to mine doesnt work :
vzs422:/in/tmp>su - linus rsh -l linus psmf 'sqlplus -s <<EOF
> select * from tab;
> exit;
> EOF'
OSF1
OSF1
End of linus's profile.
ksh: sqlplus: not found

Could you pls help ?
Closed Thread

Bookmarks

Tags
inappropriate ioctl for device

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:17 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0