The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
inline redirect stdin ct2marer Shell Programming and Scripting 5 09-09-2008 06:50 AM
Redirect stdin and out to sockets gyula High Level Programming 1 09-02-2008 07:30 AM
Array Printing Inline vakharia Mahesh Shell Programming and Scripting 2 05-21-2008 09:53 AM
redirect STDIN prkfriryce Shell Programming and Scripting 4 01-04-2007 07:11 AM
stdin not tty when try to pine or redirect Micz UNIX for Dummies Questions & Answers 1 05-20-2004 11:58 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 09-09-2008
Registered User
 

Join Date: Jun 2008
Posts: 5
inline redirect stdin

Hi:


I have the next script on ksh


#!/usr/bin/ksh
cd $FUENTES
qdesign <<-!
\$/opt/cognos/ph843e/bin/qtp <<-!
\$/opt/cognos/ph843e/bin/quiz <<-!
!
!
!

This script is very simple, i want to nest three process quiz into qtp, and this into qdesign.
When I run it , i receive the next error.

./aa[7]: !: not found
./aa[8]: !: not found

Why ?¿?¿

can i nest inline commads with input redir.


Regards
Reply With Quote
Forum Sponsor
  #2  
Old 09-09-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
I don't think you can, especially not with the same delimiter for them all. Perl has support for combining here documents but you still can't nest them there, only serialize.

Code:
perl -e 'print <<HERE; print <<THERE; print <<EVERYWHERE;
I am the walrus
HERE
The walrus was Paul
THERE
Happiness is a warm gun
EVERYWHERE
print "done.\n"'
But this is Perl only as far as I know.

What do you mean by nesting these, and how do you expect to achieve three of the "quiz" processes? Do you mean a pipeline, by any chance?

Code:
quiz | qtp | qdesign
That's still only one of each (pipes the output as quiz as the input to qtp, then the output from that as input to qdesign.)

Last edited by era; 09-09-2008 at 11:04 AM. Reason: Pipeline speculation
Reply With Quote
  #3  
Old 09-09-2008
Moderator
 

Join Date: Dec 2003
Location: /dev/fl
Posts: 1,061
I also am confused, like Era, about what you are trying to achieve.

For the record, you can nest heredocs in ksh93 as shown by the following trivial example:
Code:
#!/usr/bin/ksh93

TMP=file.$$

cat <<< $(echo "first time") > $TMP

cat <<EOF1 >> $TMP
current date: $(date)
===================
$(cat <<EOF2
second time
current date: $(sleep 1; date)
===================
$(cat <<EOF3
third time
current date: $(sleep 1; date)
EOF3
)
===================
EOF2
)
EOF1

cat $TMP

rm $TMP
Code:
$ ./trivial
first time
current date: Tue Sep  9 21:48:52 EDT 2008
===================
second time
current date: Tue Sep  9 21:48:53 EDT 2008
===================
third time
current date: Tue Sep  9 21:48:54 EDT 2008
===================
$
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0