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

sql server - NHibernate incorrectly creating ManyToMany table - Cannot define PRIMARY KEY constraint on nullable column error -

All overlapping substrings matching a java regex -

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