The tee -a command will append changes to a file (just like to >>). The -a flag stands for "append".
echo "some text" | sudo tee -a write-protected.txt
| find . -type f -exec file --mime {} \; | grep -v us-asci |
| // Originally found at: http://rangevoting.org/Qnorm.html | |
| /** * @(#)qnorm.js * * Copyright (c) 2000 by Sundar Dorai-Raj | |
| * * @author Sundar Dorai-Raj | |
| * * Email: [email protected] | |
| * * This program is free software; you can redistribute it and/or | |
| * * modify it under the terms of the GNU General Public License | |
| * * as published by the Free Software Foundation; either version 2 | |
| * * of the License, or (at your option) any later version, | |
| * * provided that any use properly credits the author. |
| # Discussion: http://stackoverflow.com/q/1005153/574190 | |
| # Railscast: http://railscasts.com/episodes/199-mobile-devices | |
| # More Infor: http://detectmobilebrowsers.com/ | |
| # Hacky because of Regex but that seems to be the way that this is done around | |
| # the net. THere are some gems out there which will provide similar | |
| # functionality. | |
| # | |
| # Check out: | |
| # |
| # Remove trailing whitespace from files in the src directory. | |
| # This is useful because (for example) trailing whitespace hinders Vim's | |
| # paragraph movement. | |
| # INFO: http://stackoverflow.com/a/4438318/574190 | |
| # INFO: http://stackoverflow.com/q/1583219/574190 | |
| # The directory under which we want to search for files. | |
| ROOT_DIRECTORY="$1" |
| sed -i '' 's/TextToChange/ChangeToThis/g' spec/features/*.rb | |
| # -i '' forces the files to be edited in place |
| # http://stackoverflow.com/a/1583282/574190 | |
| find app/views -type f -print0 -name "*.erb" | xargs -0 sed -i '' 's/Et\.trac/mixpanel\.trac/g' | |
| # Not sure why the following isn't equivilent. | |
| sed =i '' 's/Et\.trac/mixpanel\.trac/g' app/views/**/*.html.erb |