diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-12-06 14:25:39 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-12-06 14:26:06 +1300 |
commit | 0c4bf7de3604eeb00e2cf590867d43ceb2f0f85d (patch) | |
tree | 124ccc28400bfa078f0a701e6610cbba9564a710 | |
parent | Substitute bad `continue` for `return` (diff) | |
download | dotfiles-0c4bf7de3604eeb00e2cf590867d43ceb2f0f85d.tar.gz dotfiles-0c4bf7de3604eeb00e2cf590867d43ceb2f0f85d.zip |
Remove unneeded semicolon from sh "for VAR ; do"
It turns out the semicolon belongs to the "in" syntax, and is optional
without it.
-rw-r--r-- | bash/bashrc.d/keep.bash | 2 | ||||
-rw-r--r-- | bash/bashrc.d/vared.bash | 2 | ||||
-rw-r--r-- | bin/ap.sh | 2 | ||||
-rw-r--r-- | bin/apf.sh | 2 | ||||
-rw-r--r-- | bin/d2u.sh | 2 | ||||
-rw-r--r-- | bin/eds.sh | 4 | ||||
-rw-r--r-- | bin/fnp.sh | 2 | ||||
-rw-r--r-- | bin/loc.sh | 2 | ||||
-rw-r--r-- | bin/mex.sh | 2 | ||||
-rw-r--r-- | bin/mkcp.sh | 2 | ||||
-rw-r--r-- | bin/mked.sh | 2 | ||||
-rw-r--r-- | bin/mkmv.sh | 2 | ||||
-rw-r--r-- | bin/mkvi.sh | 2 | ||||
-rw-r--r-- | bin/pp.sh | 2 | ||||
-rw-r--r-- | bin/sqs.sh | 2 | ||||
-rw-r--r-- | bin/stbl.sh | 2 | ||||
-rw-r--r-- | bin/stex.sh | 2 | ||||
-rw-r--r-- | bin/stws.sh | 2 | ||||
-rw-r--r-- | bin/sue.sh | 2 | ||||
-rw-r--r-- | bin/u2d.sh | 2 | ||||
-rw-r--r-- | bin/xgo.sh | 2 | ||||
-rw-r--r-- | check/bash.sh | 2 | ||||
-rw-r--r-- | check/ksh.sh | 2 | ||||
-rw-r--r-- | check/sh.sh | 2 | ||||
-rw-r--r-- | check/xinit.sh | 2 | ||||
-rw-r--r-- | check/zsh.sh | 2 | ||||
-rw-r--r-- | ksh/kshrc.d/keep.ksh | 2 | ||||
-rw-r--r-- | sh/profile.d/options.sh | 2 | ||||
-rw-r--r-- | zsh/zshrc.d/keep.zsh | 2 |
29 files changed, 30 insertions, 30 deletions
diff --git a/bash/bashrc.d/keep.bash b/bash/bashrc.d/keep.bash index 48196aeb..191dac4b 100644 --- a/bash/bashrc.d/keep.bash +++ b/bash/bashrc.d/keep.bash @@ -83,7 +83,7 @@ EOF # Iterate through the NAMEs given local name - for name ; do + for name do # Check NAMEs for validity case $name in diff --git a/bash/bashrc.d/vared.bash b/bash/bashrc.d/vared.bash index e024f48a..491e5bff 100644 --- a/bash/bashrc.d/vared.bash +++ b/bash/bashrc.d/vared.bash @@ -24,7 +24,7 @@ vared() { return 2 fi local name - for name ; do + for name do IFS= read -e -i "${!name}" -p "${prompt:-"$name"=}" -r -- "${name?}" done } @@ -10,7 +10,7 @@ shift # Iterate through the remaining args; it's legal for there to be none, but in # that case the user may as well just have invoked the command directly -for arg ; do +for arg do # If this is the first iteration, clear the params away (we grabbed them in # the for statement) @@ -16,7 +16,7 @@ shift 2 if [ "$#" -gt 0 ] ; then # Iterate through any remaining arguments - for carg ; do + for carg do # If this is the first command argument, then before we add it, we'll # add all the ones from the file first if it exists @@ -10,7 +10,7 @@ fi r=$(printf '\r') # Iterate over arguments and apply the same ed(1) script to each of them -for fn ; do +for fn do # Note the heredoc WORD is intentionally unquoted because we want to expand # $r within it to get a literal carriage return; the escape characters @@ -21,7 +21,7 @@ case :$PATH: in esac # Prepend the path to each of the names given if they don't look like options -for arg ; do +for arg do [ -n "$reset" ] || set -- && reset=1 case $arg in --) @@ -44,7 +44,7 @@ done "${VISUAL:-"${EDITOR:-ed}"}" "$@" # Make any created scripts executable if they now appear to be files -for script ; do +for script do [ -f "$script" ] || continue chmod +x -- "$script" done @@ -4,7 +4,7 @@ [ "$#" -gt 0 ] || set -- - # Iterate through arguments -for arg ; do +for arg do # We'll print the filename "-stdin-" rather than - just to be slightly more # explicit @@ -7,7 +7,7 @@ if [ "$#" -eq 0 ] ; then fi # Iterate through each search term and run an appropriate find(1) command -for pat ; do +for pat do # Skip dotfiles, dotdirs, and symbolic links; print anything that matches # the term as a substring (and stop iterating through it) @@ -9,7 +9,7 @@ if [ "$#" -eq 0 ] ; then fi # Iterate through the given names -for name ; do +for name do # Clear the found variable found= diff --git a/bin/mkcp.sh b/bin/mkcp.sh index 10308263..3acf12f0 100644 --- a/bin/mkcp.sh +++ b/bin/mkcp.sh @@ -7,7 +7,7 @@ if [ "$#" -lt 2 ] ; then fi # Get the last argument (the directory to create) -for dir ; do : ; done +for dir do : ; done # Create it, or bail mkdir -p -- "$dir" || exit diff --git a/bin/mked.sh b/bin/mked.sh index 4e280205..93e21573 100644 --- a/bin/mked.sh +++ b/bin/mked.sh @@ -1,6 +1,6 @@ #!/bin/sh # Create paths to all files before invoking editor -for file ; do +for file do mkdir -p -- "${file%/*}" || exit done exec "$EDITOR" "$@" diff --git a/bin/mkmv.sh b/bin/mkmv.sh index 53b5aa8f..832c205e 100644 --- a/bin/mkmv.sh +++ b/bin/mkmv.sh @@ -7,7 +7,7 @@ if [ "$#" -lt 2 ] ; then fi # Get the last argument (the directory to create) -for dir ; do : ; done +for dir do : ; done # Create it, or bail mkdir -p -- "$dir" || exit diff --git a/bin/mkvi.sh b/bin/mkvi.sh index 244b89f8..c5974383 100644 --- a/bin/mkvi.sh +++ b/bin/mkvi.sh @@ -1,6 +1,6 @@ #!/bin/sh # Create paths to all files before invoking editor -for file ; do +for file do mkdir -p -- "${file%/*}" || exit done exec "$VISUAL" "$@" @@ -1,5 +1,5 @@ # Print the full path to each argument; path need not exist -for arg ; do +for arg do case $arg in /*) path=$arg ;; *) path=$PWD/$arg ;; @@ -8,7 +8,7 @@ if [ "$#" -eq 0 ] ; then fi # Iterate through the given files -for sn ; do +for sn do # Strip trailing slash if any and then query string sn=${sn%/} diff --git a/bin/stbl.sh b/bin/stbl.sh index 23d77703..2f6702b1 100644 --- a/bin/stbl.sh +++ b/bin/stbl.sh @@ -7,7 +7,7 @@ if [ "$#" -eq 0 ] ; then fi # Iterate over arguments and apply the same ed(1) script to each of them -for fn ; do +for fn do ed -s -- "$fn" <<'EOF' || ex=1 $g/^ *$/d w diff --git a/bin/stex.sh b/bin/stex.sh index 14d2cabf..b27d9cf8 100644 --- a/bin/stex.sh +++ b/bin/stex.sh @@ -13,7 +13,7 @@ ext=$1 shift # Iterate through the given files (remaining args) -for sn ; do +for sn do # Strip trailing slash if any and then extension sn=${sn%/} diff --git a/bin/stws.sh b/bin/stws.sh index ce2c14d0..59a8652a 100644 --- a/bin/stws.sh +++ b/bin/stws.sh @@ -7,7 +7,7 @@ if [ "$#" -eq 0 ] ; then fi # Iterate over arguments and apply the same ed(1) script to each of them -for fn ; do +for fn do ed -s -- "$fn" <<'EOF' || ex=1 g/ *$/ s/ *$// w @@ -4,7 +4,7 @@ user= # Iterate over the given files -for file ; do +for file do # Get the file's owner, or bail file_owner=$(stat -c %U -- "$file") || exit @@ -10,7 +10,7 @@ fi r=$(printf '\r') # Iterate over arguments and apply the same ed(1) script to each of them -for fn ; do +for fn do # Note the heredoc WORD is intentionally unquoted because we want to expand # $r within it to get a literal carriage return; the escape characters @@ -7,7 +7,7 @@ if [ "$#" -eq 0 ] ; then fi # Iterate over the URL arguments -for url ; do ( +for url do ( # Look for patterns in the URL that suggest transformations case $url in diff --git a/check/bash.sh b/check/bash.sh index 1f9e1b38..510f2af0 100644 --- a/check/bash.sh +++ b/check/bash.sh @@ -5,7 +5,7 @@ set \ bash/bash_profile \ bash/bashrc \ bash/bashrc.d/*.bash -for bash ; do +for bash do bash -n -- "$bash" || exit done printf 'GNU Bash dotfiles parsed successfully.\n' diff --git a/check/ksh.sh b/check/ksh.sh index f4bade82..cf83bc1f 100644 --- a/check/ksh.sh +++ b/check/ksh.sh @@ -1,7 +1,7 @@ set \ ksh/kshrc \ ksh/kshrc.d/*.ksh -for ksh ; do +for ksh do ksh -n -- "$ksh" || exit done sh -n -- ksh/shrc.d/ksh.sh || exit diff --git a/check/sh.sh b/check/sh.sh index 92910c11..e0162f47 100644 --- a/check/sh.sh +++ b/check/sh.sh @@ -4,7 +4,7 @@ set \ sh/shinit \ sh/shrc \ sh/shrc.d/*.sh -for sh ; do +for sh do sh -n -- "$sh" || exit done printf 'POSIX shell dotfiles parsed successfully.\n' diff --git a/check/xinit.sh b/check/xinit.sh index fa235c9d..ae03b8c2 100644 --- a/check/xinit.sh +++ b/check/xinit.sh @@ -1,7 +1,7 @@ set \ X/xinitrc \ X/xinitrc.d/*.sh -for xinit ; do +for xinit do sh -n -- "$xinit" || exit done printf 'Xinit startup scripts parsed successfully.\n' diff --git a/check/zsh.sh b/check/zsh.sh index ce209584..0170e586 100644 --- a/check/zsh.sh +++ b/check/zsh.sh @@ -2,7 +2,7 @@ set \ zsh/zprofile \ zsh/zshrc.d/*.zsh \ zsh/zshrc -for zsh ; do +for zsh do zsh -n -- "$zsh" || exit done sh -n zsh/profile.d/zsh.sh || exit diff --git a/ksh/kshrc.d/keep.ksh b/ksh/kshrc.d/keep.ksh index f6593c3d..629b2fe6 100644 --- a/ksh/kshrc.d/keep.ksh +++ b/ksh/kshrc.d/keep.ksh @@ -94,7 +94,7 @@ EOF # Iterate through the NAMEs given typeset name - for name ; do + for name do # Check NAMEs for validity case $name in diff --git a/sh/profile.d/options.sh b/sh/profile.d/options.sh index 73f62243..f89967cb 100644 --- a/sh/profile.d/options.sh +++ b/sh/profile.d/options.sh @@ -22,7 +22,7 @@ options() { # Iterate through remaining arguments (desired options), creating files to # show they're available if found in the help output - for opt ; do + for opt do command -p grep -q -- '[^[:alnum:]]--'"$opt"'[^[:alnum:]]' help && touch -- "$opt" done diff --git a/zsh/zshrc.d/keep.zsh b/zsh/zshrc.d/keep.zsh index 59696301..c47748cd 100644 --- a/zsh/zshrc.d/keep.zsh +++ b/zsh/zshrc.d/keep.zsh @@ -83,7 +83,7 @@ EOF # Iterate through the NAMEs given local name - for name ; do + for name do # Check NAMEs for validity case $name in |