Sed in-place edit a file
# Remove comments in a Gemfile
# Edit and replace without using a temporary file (all in one swoop)
sed -i '' \
-e 's/#.*$//g' \
-e '/^[ \t]*$/d' \
Gemfile
last updated march 2016
# Remove comments in a Gemfile
# Edit and replace without using a temporary file (all in one swoop)
sed -i '' \
-e 's/#.*$//g' \
-e '/^[ \t]*$/d' \
Gemfile