diff options
-rwxr-xr-x | link.zsh | 6 | ||||
-rwxr-xr-x | pdf.zsh | 8 | ||||
-rwxr-xr-x | prune.zsh | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/link.zsh b/link.zsh index f5ed565c..8d573ceb 100755 --- a/link.zsh +++ b/link.zsh @@ -5,15 +5,15 @@ if [[ $# -eq 1 ]]; then linkPath="$1" filePath="$PWD/home/${linkPath#$HOME/}" [[ ! -f "$filePath" ]] - mkdir -p $(dirname "$filePath") + mkdir -p "$(dirname "$filePath")" mv "$linkPath" "$filePath" fi -find home -type f | while read findPath; do +find home -type f | while read -r findPath; do filePath="$PWD/$findPath" linkPath="$HOME/${findPath#home/}" [[ -L "$linkPath" ]] && continue - mkdir -p $(dirname "$linkPath") + mkdir -p "$(dirname "$linkPath")" ln -s "$filePath" "$linkPath" echo "$linkPath" done diff --git a/pdf.zsh b/pdf.zsh index 79e3309c..d9aab752 100755 --- a/pdf.zsh +++ b/pdf.zsh @@ -9,8 +9,12 @@ fetch() { echo "pdf/$1" } -elf() { fetch "$1" "http://refspecs.linuxbase.org/elf/$2" } -intel() { fetch "$1" "https://software.intel.com/sites/default/files/managed/$2" } +elf() { + fetch "$1" "http://refspecs.linuxbase.org/elf/$2" +} +intel() { + fetch "$1" "https://software.intel.com/sites/default/files/managed/$2" +} elf abi.pdf x86_64-abi-0.99.pdf elf elf.pdf elf.pdf diff --git a/prune.zsh b/prune.zsh index a0eb1f73..928fe066 100755 --- a/prune.zsh +++ b/prune.zsh @@ -1,7 +1,7 @@ #!/usr/bin/env zsh set -o errexit -o nounset -o pipefail -find -L ~ -type l -lname "$PWD/*" | while read linkPath; do +find -L ~ -type l -lname "$PWD/*" | while read -r linkPath; do rm "$linkPath" echo "$linkPath" done |