-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathcp_mv_progress_bar.sh
More file actions
41 lines (35 loc) · 1.08 KB
/
cp_mv_progress_bar.sh
File metadata and controls
41 lines (35 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# sudo check
if [ `whoami` = root ];
then
echo Please do not run this script as root or using sudo
return 1 2>/dev/null
exit 1
fi
# Pre requisites
sudo apt-get install build-essential -y
# Download coreutils
cd /home/"$USER"
wget https://ftp.gnu.org/gnu/coreutils/coreutils-9.5.tar.xz
tar xvJf coreutils-9.5.tar.xz
cd /home/"$USER"/coreutils-9.5
# Download and apply the patch
wget https://raw.githubusercontent.com/jarun/advcpmv/master/advcpmv-0.9-9.5.patch
patch -p1 -i advcpmv-0.9-9.5.patch
./configure
make
# Save the patched binaries
mkdir /home/"$USER"/patched
cp /home/"$USER"/coreutils-9.5/src/cp /home/"$USER"/patched
cp /home/"$USER"/coreutils-9.5/src/mv /home/"$USER"/patched
# Clean
cd /home/"$USER"
rm -rf /home/"$USER"/coreutils-9.5
rm /home/"$USER"/coreutils-9.5.tar.xz
# Copy modfied binaries
sudo cp /home/"$USER"/patched/cp /usr/local/bin/cp
sudo cp /home/"$USER"/patched/mv /usr/local/bin/mv
# Alias
echo 'alias cp="/usr/local/bin/cp -g"' >> .bashrc
echo 'alias mv="/usr/local/bin/mv -g"' >> .bashrc
echo "To apply run this command 👉 'source .bashrc' "