clear echo "Before:" echo "Gem actionmailer-4.2.0" echo "actionpack (= 4.2.0)" echo "actionview (= 4.2.0)" echo "activejob (= 4.2.0)" echo "mail (>= 2.5.4, ~> 2.5)" echo "rails-dom-testing (>= 1.0.5, ~> 1.0)" gem dependency > dependsgem.txt echo '(F/.M/d h)' | sed 's/(.*)//' dependsgem.txt > dependsgem1.txt sed -e '/^[A-Z]/d' dependsgem1.txt > dependsgem2.txt sed -e 's/^[ \t]*//' dependsgem2.txt > dependsgem3.txt sed '/^$/d' dependsgem3.txt > dependsgem4.txt sudo perl -lane 'print "@F" if @F = grep !$seen{$_}++, @F' < dependsgem4.txt > dependsgem5.txt ls -1 | awk 'ORS=" "' dependsgem5.txt > dependsgem6.txt fold -s dependsgem6.txt > dependsgem7.txt while read LINE;do LARGE="sudo gem install $LINE";echo $LARGE>>dependsgem.sh;done