The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

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 09:50 AM
Redirect stdin and out to sockets gyula High Level Programming 1 09-02-2008 10:30 AM
Array Printing Inline vakharia Mahesh Shell Programming and Scripting 2 05-21-2008 12:53 PM
redirect STDIN prkfriryce Shell Programming and Scripting 4 01-04-2007 10:11 AM
stdin not tty when try to pine or redirect Micz UNIX for Dummies Questions & Answers 1 05-20-2004 02:58 PM

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 09-09-2008
ct2marer ct2marer is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 8
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
  #2 (permalink)  
Old 09-09-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
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 02:04 PM.. Reason: Pipeline speculation
  #3 (permalink)  
Old 09-09-2008
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,924
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
===================
$
Closed Thread

Bookmarks

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:25 PM.


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