OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [tools/] [replace_words] - Rev 8

Go to most recent revision | Compare with Previous | Blame | View Log

#!/bin/bash

original=(a b c d)
replacement=(w x y z)

# Test that we have both arguments
if [ -z "$1" ]; then
        echo Usage: replace_words DIRNAME ORIGINAL REPLACEMENT
        exit
fi

for ((i=0;i<1;i++));
do

        #orig=${original[$i]}
        #repl=${replacement[$i]}
        orig=$2
        repl=$3
        for filename in `find $1 -name '*.[ch]'`
        do
                echo Replacing $orig with $repl in $filename
                sed -i -e "s/$orig/$repl/g" $filename
        done
done

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.