All pastes #940630 Raw Edit

bash script looping?

public shellscript v1 · immutable
·published 2008-03-13 03:09 UTC
rendered paste body
#!/bin/bash      for VHFILE in ./virthosts/*      do          if sed 's/68\.12\.54\.142/65.43.123.23/g' "./virthosts/$VHFILE" > /tmp/hosttemp.txt \             && cat /tmp/hosttemp.txt >> "./virthosts/$VHFILE" \             && rm -f /tmp/hosttemp.txt          then              echo "Done with \"$VHFILE\"."          else              echo "Failure at \"$VHFILE\"."          fi      done