Skip to content

Instantly share code, notes, and snippets.

@wangjiezhe
Last active October 23, 2022 22:42
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wangjiezhe/b978fc93b62e75bfad9c to your computer and use it in GitHub Desktop.
Save wangjiezhe/b978fc93b62e75bfad9c 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}
@wangjiezhe
Copy link
Author

wangjiezhe commented Nov 7, 2020

@harshrathod50 This script is not maintained now and the link is outdated. You can follow https://github.com/jarun/advcpmv#build-instructions to install advcp.

@harshrathod50
Copy link

Okay, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment