Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
install 'cp' and 'mv' utilities with progress bar patches
#!/usr/bin/env bash
set -e
tmpdir=$(mktemp -t -d advcp.XXXXXX)
cd ${tmpdir}
wget https://aur.archlinux.org/packages/ad/advcp/advcp.tar.gz
tar xf advcp.tar.gz
source advcp/PKGBUILD
wget http://ftp.gnu.org/gnu/coreutils/coreutils-"${_pkgver}".tar.xz
tar xf coreutils-"${_pkgver}".tar.xz
cd coreutils-"${_pkgver}"
echo "Patching..."
patch -p1 -i ../advcp/advcpmv-"${_pkgver}"_"${pkgver}".patch || exit 1
echo "Start making..."
./configure || exit 1
make || exit 1
sudo install -Dm 755 "${PWD}"/src/cp /usr/local/bin/acp
sudo install -Dm 755 "${PWD}"/src/mv /usr/local/bin/amv
echo "Installation succeeded!"
echo "Don't forget to add \"alias cp='acp -g'\" and \"alias mv='amv -g'\" in your bashrc!"
rm -rf ${tmpdir}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.