Ask Your Question

Revision history [back]

You can try:

sage -c <<< MyProgram1 | MyProgram2 > final_output

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