removed first set of warnings via shellcheck

This commit is contained in:
Tobias Schmidl 2021-12-11 11:49:53 +01:00
parent 24f2749870
commit 94e92ad11c
4 changed files with 32 additions and 11 deletions

View file

@ -1,8 +1,16 @@
#! /bin/zsh
alias cdiff="colordiff" alias cdiff="colordiff"
[ -x "$(which gpg2)" ] && alias clean-gpg="for a in `gpg2 -k | sed -rn 's/pub +[a-z0-9]+\/(0x[0-9A-Fa-f]+).*/\1/p'`; do gpg2 --quiet --no-tty --edit-key $a clean save; done;" function clean-gpg () {
[ -z "$(command -v gpg2)" ] && exit 1;
for key in $(gpg2 -k | sed -rn 's/pub +[a-z0-9]+\/(0x[0-9A-Fa-f]+).*/\1/p');
do
gpg2 --quiet --no-tty --edit-key "$key" clean save
done
}
alias diff="diff -W $(( $(tput cols) - 2))" alias diff="diff -W \$(( \$(tput cols) - 2))"
alias bz2c='bzip2 --best' alias bz2c='bzip2 --best'
alias gzc='gzip --best --no-name' alias gzc='gzip --best --no-name'
@ -20,7 +28,8 @@ alias urlencode='python3 -c "import sys, urllib.parse as ul; [sys.stdout.write(u
function mkcdir () { function mkcdir () {
mkdir -p -- "$1" && mkdir -p -- "$1" &&
cd -P -- "$1" cd -P -- "$1" ||
exit 1
} }
function chrooted() { function chrooted() {
@ -32,13 +41,19 @@ function chrooted() {
else else
echo "We are chrooted." echo "We are chrooted."
fi fi
# shellcheck disable=SC2046
# Word splitting *cannot* occur in a result of `test`
return $(test "$ROOT_MP" -eq "$SHELL_MP") return $(test "$ROOT_MP" -eq "$SHELL_MP")
} }
if [ -x "$(which lsb_release)" ]; if [ -x "$(which lsb_release)" ];
then then
current_dist=`lsb_release -c -s` current_dist="$(lsb_release -c -s)"
all_dkms_packages="`apt-cache rdepends --installed dkms | sed -rn 's/^ +([^ ]+)$/\1/p' | sort -iu | tr '\n' ' '`" all_dkms_packages="$(apt-cache rdepends --installed dkms | sed -rn 's/^ +([^ ]+)$/\1/p' | sort -iu | tr '\n' ' ')"
# shellcheck disable=SC2154,2086
# both errors are irrelevant as we are part of a bigger infrastructure
if [ $use_sudo -eq 1 ]; if [ $use_sudo -eq 1 ];
then then
alias aar='sudo apt-get --purge autoremove' alias aar='sudo apt-get --purge autoremove'

View file

@ -1,6 +1,9 @@
function duckduck() { elinks -dump "https://duckduckgo.com/?q=`escape "$@"`"; } #! /bin/zsh
function escape() { perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "$@"; }
function google() { elinks -dump "https://www.google.de/search?q=`escape "$@"`"; }
function wetter() { curl --tr-encoding -H "Accept-Language: ${LANG%_*}" "https://wttr.in/$@"; } function escape() { perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "$@"; }
function wetter2() { curl --tr-encoding -H "Accept-Language: ${LANG%_*}" "https://v2.wttr.in/$@"; }
function duckduck() { elinks -dump "https://duckduckgo.com/?q=$(escape "$@")"; }
function google() { elinks -dump "https://www.google.de/search?q=$(escape "$@")"; }
function wetter() { curl --tr-encoding -H "Accept-Language: ${LANG%_*}" "https://wttr.in/$*"; }
function wetter2() { curl --tr-encoding -H "Accept-Language: ${LANG%_*}" "https://v2.wttr.in/$*"; }

View file

@ -1,3 +1,5 @@
#! /bin/zsh
alias exa='exa -FHhg@ --git --time-style long-iso' alias exa='exa -FHhg@ --git --time-style long-iso'
alias exal='exa -l' alias exal='exa -l'
function exat() { function exat() {

View file

@ -1,5 +1,6 @@
#! /bin/zsh
# Make sure we include this file only once # Make sure we include this file only once
if [ -z $ZSH_LOCAL_BIN_ALREADY_SET ]; if [ -z "$ZSH_LOCAL_BIN_ALREADY_SET" ];
then then
export ZSH_LOCAL_BIN_ALREADY_SET=1 export ZSH_LOCAL_BIN_ALREADY_SET=1
# set PATH so it includes user's private bin if it exists # set PATH so it includes user's private bin if it exists