Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. DC:D3:21:75:61:90 ; 10.25.131.17
  2. ;
  3.  
  4. Host 27-48 { hardware ethernet DC:D3:21:75:61:90 ; fixed-address 10.25.131.17 ; }
  5.  
  6. #host 27-48 { hardware ethernet ; fixed-address ; }
  7.  
  8. Host 27-48 { hardware ethernet 00:16:6B:C8:3D:C9 ; fixed-address 10.25.129.185
  9.  
  10. outputLine="Host $((names[i]))-$((startingNumber+counter)) { hardware ethernet $first ; fixed-address $second"
  11.  
  12. outputLine="Host $((names[i]))-$((startingNumber+counter)) { hardware ethernet $first ; fixed-address $second ; }"
  13.  
  14. ; } 27-48 { hardware ethernet 00:16:6B:C8:3D:C9 ; fixed-address 10.25.129.185
  15.  
  16. for ((j=1; j<=${sizes[i]}; j++ )); do
  17.  
  18. #split line, read split as two entries for an arrIN
  19. IN=(${line[counter+1]})
  20. arrIN=(${IN//;/ })
  21. first="${arrIN[0]}"
  22. second=${arrIN[1]}
  23.  
  24.  
  25. if [ ${lineSize[counter+1]} -gt 5 ]
  26. then
  27. #sed 's/$/ ; }/' $outputLine > newoutputLine
  28. outputLine="Host $((names[i]))-$((startingNumber+counter)) { hardware ethernet $first ; fixed-address $second"
  29. echo $outputLine
  30. else
  31. echo "#host $((names[i])) $((startingNumber+counter)) { hardware ethernet ; fixed-address ; }"
  32. fi
  33. counter=$((counter+1))
  34. done
  35.  
  36. $ printf 'abcrd' # `printf 'r'` produces a CR
  37. dbc # It LOOKS LIKE 'd' replaced 'a', but that's an artifact of printing to the terminal.
  38.  
  39. $ printf 'abcrd' | cat -et
  40. abc^Md # ^M represents a CR (r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement