loops - bash ssh script not outputting results to file -
Using a simple script in the work and I can not understand why the results will not be in any other file.
/ tmp / system
stores the node list
#! / Bin / bash $ result = restest.txt in $ i (cat / tmp) / system); Ping-C1 $ i [$ i = 0]; Then SSH $ i ps -ef | Grape Ops | Echo & gt; For the results,
The echo is not printed with stdin, but its arguments Line if there is no logic). Therefore,
echo file.txt
prints 'file.txt' only, not the content of the file. So your code just writes a new line in the file. You can use stdin to stdout at stdout, but here it is useless, because you can pipe directly into the grep output file:
ssh $ i ps -ef | Grep Ops & gt; $ Result
Comments
Post a Comment