Advertisement
Guest User

make dir for utils

a guest
Apr 23rd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.38 KB | None | 0 0
  1. ################
  2. ## SCRIPT UTILS PACK MORE SERV
  3. ################
  4.  
  5.  
  6. ##### EXAMPLE
  7. ##### HOSTNAME='COMP1 COMP2 COMP3'
  8. ##################################
  9.  
  10. SERVER_HOSTNAME='COMP1 COMP2 COMP3'
  11.  
  12. declare -a ARRAY_HOSTNAME=(${SERVER_HOSTNAME})
  13.  
  14. ARRAY_COUNT=$(printf '%s\n' "${ARRAY_HOSTNAME[@]}" | wc -l)
  15.  
  16. for ((i=0;i<${ARRAY_COUNT};i++));
  17. do
  18.    mkdir ${ARRAY_HOSTNAME[$i]}
  19. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement