Skip to content

Instantly share code, notes, and snippets.

@tripleo1
Forked from wangjiezhe/advcp_install.sh
Created October 23, 2022 22:42
Show Gist options
  • Save tripleo1/0e90dc89dbb027180f72fc202a4fe7b2 to your computer and use it in GitHub Desktop.
Save tripleo1/0e90dc89dbb027180f72fc202a4fe7b2 to your computer and use it in GitHub Desktop.
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