Is this bad practice?  Also, how can it be improved?#!/usr/bin/env bashRUBY_VERSION=2.1.0printf Installing Ruby $RUBY_VERSION\\nif [ -d ruby_build ]; then    rm -Rf ruby_buildfiif [[ `command -v ruby` && `ruby --version | colrm 11` == ruby $RUBY_VERSION ]] ; then    echo You already have this version of Ruby: $RUBY_VERSION    exit 113fisudo apt-get build-dep -y ruby1.9.1mkdir ruby_build && cd ruby_buildcurl -O http://ftp.ruby-lang.org/pub/ruby/2.1/ruby-$RUBY_VERSION.tar.gztar xf ruby-$RUBY_VERSION.tar.gzcd ruby-$RUBY_VERSION./configuremakesudo checkinstall -y --pkgversion $RUBY_VERSION --provides ruby-interpreter --replaces=ruby-1.9.2cd ../.. && rm -Rf ruby_build
Ruby install script; packages+installs as a .deb or .rpm from source
bash;installer
First,I would like to point out that not all .deb-based distributions are as fond of sudo as Ubuntu is. For example, Debian doesn't use sudo out of the box.It appears that you're trying to build a newer version of Ruby than is available in the stock package repository. In that case, why not make a proper .deb package with its .dsc and publish it in a private APT repository?  Then, everything integrates properly into the distribution the way package management is supposed to work, including the build process and subsequent updates.  Everyone will have a better experience when you work with the system instead of against it.