Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@qubodup
Created April 12, 2015 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qubodup/7ad4baa98aec1d7adf7d to your computer and use it in GitHub Desktop.
Save qubodup/7ad4baa98aec1d7adf7d to your computer and use it in GitHub Desktop.
# http://stackoverflow.com/questions/21146211/
for i in $*
do
echo $i
sed \
-e 's/get_progress(P_\([_A-Za-z0-9]*\))/progress\.\L\1/g' \
-e 's/set_progress(P_\([_A-Za-z0-9]*\), \([0-9_a-zA-Z+ -\.]*\))/progress\.\L\1 = \2/g' \
-e 's/P_\([_A-Z0-9]*\)/progress\.\L\1/g' \
$i > $i-low
mv $i-low $i
done
# I'm confused though, why - doesn't work when escaped inside [ ] see:
# http://stackoverflow.com/questions/4009817/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment