code_junkie

writing bash script to change text and write to a log

Nov 12th, 2011
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. sed -i '0,/dev/ s/dev/stage/' config.inc.php
  2.  
  3. sed -i "/<dev>/,/<dev>/ s/dev/stage/" config.inc.php
  4.  
  5. date >> /path/to/dev/run.log
  6.  
  7. sed -i -r '0,/<dev>/s/<dev>/stage/' config.inc.php
  8.  
  9. cat config.inc.php | sed 's:dev::stage' > config.inc.php.new
  10.  
  11. echo $timestamp >> mylogfile.log
  12.  
  13. sed -i -e s/dev/stage/ config.inc.php
Add Comment
Please, Sign In to add comment