linux - How to get standard output from subshell? -


i have script this?

command='scp xxx 192.168.1.23:/tmp' su - nobody -c "$command" 

the main shell didn't print info. how can output sub command?

you can of output redirecting corresponding output channel:

command='scp ... ' su - nobody -c "$command" > file 

or

var=$(su - nobody -c "$command") 

but if don't see anything, maybe diagnostics output of scp disabled? there "-q" option somewhere in real command?


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -