0

I run this pdsh script :

    #!/bin/bash
    ServersListFile=/etc/pdsh/root_audit
    Result=/etc/pdsh/SudoRoot.csv

    /opt/techunix/bin/pdsh.sh -f $ServersListFile -c "hostname" >> $Result

i get on the output only this:
Command to execute : hostname
Output can be treated with dshbak command

and on the screen :
pdsh@pradminux: DVACSDXS01: ssh exited with exit code 255

how can i get the output also on the file ?

Med
  • 125
  • 1
  • 2
  • 13

1 Answers1

0

If you want the error message in the output file, then you will have to redirect the error stream to the same place as the output stream:

/opt/techunix/bin/pdsh.sh -f "$ServersListFile" -c "hostname" >>"$Result" 2>&1
Kusalananda
  • 320,670
  • 36
  • 633
  • 936