#! /bin/bash # Execute this script to remove an user from the cluster globally echo 'Existing users in /etc/passwd of '$HOSTNAME cat /etc/passwd | awk -F":" '{print $1, $3}' | awk '{if($2>=1000 && $2<4000) {print}}' | sort echo ' ' read -p "Enter username to delete: " username command='userdel -rf '"$username" /share/bin/pdsh_sshreachable > /dev/null hosts=$(cat /share/tmp/ssh-reachable.dat) pdsh -R ssh -w ^/share/tmp/ssh-reachable.dat $command