Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You probably already know this, but if you have a significant number of hosts:

    for i in `seq 1 30`; do \
        echo -e "\nhost$i\n===========\n"; \
        ssh host$i 'ln -s /some/path /path/to/link && ls -l /path/to/link'; \
    done
Also, if you just start typing

  for i in `seq 1 30`
  do
     commands
     more commands
  done
On the command line itself, you don't need to worry about semicolons. Bash will take care of it.


Ah, I was not aware of seq; good one. :)

Good point about not needing semicolons for multiple-line stuff (assuming the EOL's are not escaped, as you have it in your example). I blame the PHP I spent all week immersed in...bleh.


    for i in {1..30}; do...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: