c - how to redirect printf output from application to script executing the application? -


when call external application program in shell script, how can i

get output of printf in executable application(a.out) , print them on shell prompt?

script:

status_cmd="agqmi stop $pdh $cid"  `$status_cmd`   clear_state  echo done 

agqmi application have printf success , failure cases, need see them in shell output not able view when ran script.

output:

clearing state...  done 

the standard output of script inherited programs run script. can redirect individual programs, or capture output variable.

#!/bin/sh one_output=$(one -foo "bar" -baz <quux) echo "the output 'one' '$one_output'" 2 -pounds "$1" >two_out echo "the output 'two' in file 'two_out'" cat two_out echo "here output 'three'" 3 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -