Skip to content

Instantly share code, notes, and snippets.

@wangjiezhe
Last active October 23, 2022 22:42
Show Gist options
  • 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}
@harshrathod50
Copy link

[root@vps47654603 advcp]# ./advcp_install.sh
--2020-11-02 06:58:28--  https://aur.archlinux.org/packages/ad/advcp/advcp.tar.gz
Resolving aur.archlinux.org (aur.archlinux.org)... 2a01:4f9:c010:50::1, 95.216.144.15
Connecting to aur.archlinux.org (aur.archlinux.org)|2a01:4f9:c010:50::1|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2020-11-02 06:58:29 ERROR 404: Not Found.

I get this error upon executing the script.

@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