From Abdelkarim Mateos, 2 Years ago, written in Bash.
This paste is a reply to Running process on loop from Abdelkarim Mateos - view diff
Embed
  1. #!/bin/bash
  2.  
  3. while read A; do
  4. echo $A
  5. ssh -n backuser@backuphost "[[ -d /Volumes/MACBACKUP/desarrollo_backups/$A ]] || mkdir /Volumes/MACBACKUP/desarrollo_backups/$A; touch /Volumes/MACBACKUP/desarrollo_backups/$A/backup.marker"
  6. bash test2.sh
  7. done < cuentas.txt
  8.  
  9.  
  10. test2.sh
  11. #!/usr/bin/bash
  12. echo  "Hello world"
  13.  
  14.  
  15.  
  16.  
  17.  
  18. Result -->
  19. account1
  20. Hello world
  21. account2
  22. Hello world
  23. account3
  24. Hello world
  25. account4
  26. Hello world
  27. account5
  28. Hello world
  29.  
  30. Hello world
  31.