First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can try:

sage -c <<< MyProgram1 | MyProgram2 > final_output
click to hide/show revision 2
No.2 Revision

You can try:

sage -c <<< MyProgram1 | MyProgram2 > final_output

Also, imagine MyProgram1 contains the following (do not forget the ';' between the commands):

#!/bin/bash
echo 'print 2+2'
sleep 4
echo ';'
echo 'print "toto"'

You can do, for example:

 sage -c $(./MyProgram1) | sed 's/4/5/g' > final_output

and get, in final_output:

5
toto