1 #!/bin/sh 2 #********************************************************************* 3 # Sample using a "for" loop to run cmd against a set of users/files. * 4 # The command is on this command line, the list is in a file. * 5 #********************************************************************* 6 7 cmd_to_run="$1" 8 input_file="$2" 9 10 user_list=`cut -d'#' -f1 "$input_file" | grep '^[a-z]'` 11 12 for name in $user_list 13 do 14 echo "************************** $name **************************" 15 $cmd_to_run $name 16 done 17 18 #********************************************************************* 19 # Also see the example using a while loop and the read statement to * 20 # run a set of # commands against a list of client systems, * 21 # directories, etc. in the remote system maintenance pages. * 22 #***************************************************************** #02 |