I have a shell script that I'm working on that uses pssh to get the user id of a user on a remote server:
for USER in $(cat users.txt); do
runuser -l mike -c 'pssh -H server.mike.com -o /home/mike/output id -u $USER'
cat /home/mike/output/server.mike.com
The file users.txt contains one line
mikeghen
When I run my script, I get an error:
[1] 14:23:15 [FAILURE] server.mike.com Exited with error code 1\
But, when I run the command:
runuser -l mike -c 'pssh -H server.mike.com -o /home/mike/output id -u mikeghen'
I don't get the error:
[1] 13:11:53 [SUCCESS] server.mike.com
I feel like this has something to do with a question I asked before, Why is permission denied during pssh?, and so I tried wrapping my command in quotes with no luck. Any suggestions?