#!/bin/sh
# to make this file executable on linux, use
# chmod a+x <this script>
# http://www.askdavetaylor.com/how_do_i_read_lines_of_data_in_a_shell_script.html
while read inputline
do
# skip lines with a !
char1="$(echo $inputline | cut -d" " -f1)"
# note: "!" isn't a good line-commenter for linux
if [ $char1 = "::" ]
then
.
# Do nothing: skip line
else
boxname="$(echo $inputline | cut -d" " -f1)"
passwrd="$(echo $inputline | cut -d" " -f2)"
#echo "computer is named $boxname"
#echo "and password is $passwrd"
# ensure the node is reachable first, otherwise skip
# ping
# call the script that retrieves the results
./winexe-static-081123 -U $boxname/physics%$passwrd //$boxname 'cmd /c c:\research_dump1\copy_back.cmd <master_share_IP>'
fi
done < ../nodes_single.txt
exit 0