DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Sed Substitution

12.10.2007
| 6843 views |
  • submit to reddit
        // Sed used to replace a string

#!/bin/bash

for line in `ls`
do
        sed -e 's/Spring/Regular Season/g' line > tmp
        mv tmp line
        echo -n $line
        grep Regular $line
done