Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bash RC helper functions
# Custom git repos update function
git-repos-update() {
local currdir=$(pwd)
for root in /opt ~/.opt; do
for D in $root/*; do
if [ -d "${D}" ]; then
cd "${D}"
cat .git/config 2>/dev/null | \
grep url | \
cut -d" " -f 3 && \
git pull -v 2>/dev/null
fi
done
done
cd "${currdir}"
}
# pip-update
pip2-upgrade() {
sudo pip2 list --outdated | \
cut -d' ' -f1 | \
egrep -v "^(\-|Package|distro\-info)" | \
xargs -n1 sudo pip2 install -U
}
pip3-upgrade() {
pip3 list --outdated | \
cut -d' ' -f1 | \
egrep -v "^(\-|Package|distro\-info)" | \
xargs -n1 sudo pip3 install -U
}
# Custom system update function
system-update() {
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get autoremove -y
sudo apt-get autoclean
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment