09-07-2014, 04:01 PM
# Get the number, store it in an intermediary variable, and use it as an argument
number=$(./NumDisplayer)
./NumAnalyzer $number
# or just:
./NumAnalyzer $(./NumDisplayer)
But this won't work if NumDisplayer needs to be constantly running. Edit: Cosmo's solution below is the way to do it in this case.
Another way in this case would be to re-write your NumAnalyzer so that it reads numbers from stdin (e.g. using scanf/cin/read/whatever) instead of looking for them as command line arguments. Then you can use a pipe (or FIFOs, as thoughtfully says).
number=$(./NumDisplayer)
./NumAnalyzer $number
# or just:
./NumAnalyzer $(./NumDisplayer)
But this won't work if NumDisplayer needs to be constantly running. Edit: Cosmo's solution below is the way to do it in this case.
Another way in this case would be to re-write your NumAnalyzer so that it reads numbers from stdin (e.g. using scanf/cin/read/whatever) instead of looking for them as command line arguments. Then you can use a pipe (or FIFOs, as thoughtfully says).