Fix shellcheck findings
This commit is contained in:
parent
44d0f1f769
commit
e9b2121e65
8 changed files with 11 additions and 7 deletions
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Head as much as fits on screen
|
# Head as much as fits on screen
|
||||||
exec head -n $(echo "$(tput lines) - 5" | bc) "$@"
|
exec head -n "$(echo "$(tput lines) - 5" | bc)" "$@"
|
||||||
|
|
1
bin/lock
1
bin/lock
|
@ -9,6 +9,7 @@ error() {
|
||||||
[ -n "$1" ] || error "input file missing"
|
[ -n "$1" ] || error "input file missing"
|
||||||
[ -r "$1" ] || error "can't read input file"
|
[ -r "$1" ] || error "can't read input file"
|
||||||
|
|
||||||
|
# shellcheck disable=SC2016 # I don't want $(tty) to be expanded
|
||||||
printf '#!/bin/sh
|
printf '#!/bin/sh
|
||||||
GPG_TTY=$(tty)
|
GPG_TTY=$(tty)
|
||||||
export GPG_TTY
|
export GPG_TTY
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage:
|
echo "Usage:
|
||||||
|
|
||||||
$(basename $0) [-h] <volume> -- generate /etc/fstab entry to prevent automount on macOS
|
$(basename "$0") [-h] <volume> -- generate /etc/fstab entry to prevent automount on macOS
|
||||||
|
|
||||||
where:
|
where:
|
||||||
-h print this help
|
-h print this help
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Tail as much as fits on screen
|
# Tail as much as fits on screen
|
||||||
exec tail -n $(echo "$(tput lines) - 5" | bc) "$@"
|
exec tail -n "$(echo "$(tput lines) - 5" | bc)" "$@"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
scriptname=`basename "$0"`
|
scriptname=$(basename "$0")
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: $scriptname SHARE [...]"
|
echo "Usage: $scriptname SHARE [...]"
|
||||||
|
@ -15,7 +15,7 @@ mount_share() {
|
||||||
share="$1"
|
share="$1"
|
||||||
sudo mkdir "/mnt/$share"
|
sudo mkdir "/mnt/$share"
|
||||||
sudo chmod 777 "/mnt/$share"
|
sudo chmod 777 "/mnt/$share"
|
||||||
sudo mount -t vboxsf -o uid=$UID,gid=$(id -g) "$share" "/mnt/$share"
|
sudo mount -t vboxsf -o uid=$UID,gid="$(id -g)" "$share" "/mnt/$share"
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
|
|
@ -150,7 +150,7 @@ main() {
|
||||||
while getopts 'hny' opt; do
|
while getopts 'hny' opt; do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
n) # dry run
|
n) # dry run
|
||||||
cmd='echo'
|
CMD='echo'
|
||||||
echo "${yellow}Performing dry run (no changes will be made).${sgr0}"
|
echo "${yellow}Performing dry run (no changes will be made).${sgr0}"
|
||||||
echo
|
echo
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
# shellcheck shell=sh
|
||||||
|
# shellcheck disable=SC2034 # Variables defined here are meant to be used in the
|
||||||
|
# script that sources this file.
|
||||||
|
|
||||||
# Where to install the dotfiles, usually $HOME.
|
# Where to install the dotfiles, usually $HOME.
|
||||||
DESTDIR="$HOME"
|
DESTDIR="$HOME"
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,6 @@ setup_commands() {
|
||||||
GIT="${dry}git"
|
GIT="${dry}git"
|
||||||
GZIP="${dry}gzip"
|
GZIP="${dry}gzip"
|
||||||
HELP2MAN="${dry}help2man"
|
HELP2MAN="${dry}help2man"
|
||||||
LN="${dry}ln"
|
|
||||||
MKDIR="${dry}mkdir"
|
MKDIR="${dry}mkdir"
|
||||||
MV="${dry}mv"
|
MV="${dry}mv"
|
||||||
PANDOC="${dry}pandoc"
|
PANDOC="${dry}pandoc"
|
||||||
|
|
Loading…
Add table
Reference in a new issue