Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion f
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# ~/bin/f
# Run ~/bin/w [find possibly misspelled words] on argument or current directory items (excluding hidden items)
# This could be switched to include hidden items...
dir=$(dirname -- "$0")
dir=$(realpath -- "$dir" || { cd "$dir" && pwd ;})

if [ -n "$1" ]; then
where="$1"
else
Expand Down Expand Up @@ -43,4 +46,4 @@ Q="'"
D1='$1'
pDIR=`echo $DIR|perl -pne "s/(\\S+)/-name $D1 -prune -o /g"`
pEXT=`echo $EXT|perl -pne "s/(\\S+)/-iname $Q*.$D1$Q -prune -o /g"`
find $where $pDIR $pEXT -type f -print0 | xargs -0 ~/bin/w | ~/bin/w 2>/dev/null
find $where $pDIR $pEXT -type f -print0 | xargs -0 "${dir}/w" | "${dir}/w" 2>/dev/null
4 changes: 3 additions & 1 deletion gl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh
# ~/bin/gl
# Run ~/bin/gl.pl
~/bin/gl.pl | uniq
dir=$(dirname -- "$0")
dir=$(realpath -- "$dir" || { cd "$dir" && pwd ;})
"$dir/gl.pl" | uniq
7 changes: 5 additions & 2 deletions rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# commit: s {spelling|new}
# currently top level hidden directories are ignored,
# this avoids accidentally scribbling over .hg/ or similar
dir=$(dirname -- "$0")
dir=$(realpath -- "$dir" || { cd "$dir" && pwd ;})

old=$1
new=$2
if [ "$new" = "$HOME" ]; then
Expand Down Expand Up @@ -31,6 +34,6 @@ esac
find . -mindepth 1 -maxdepth 1 -type f -name '.*' -0
) |
xargs -0 grep $usenull -l -i "$old" |
xargs -0 -I '<>' ~/bin/r "s{$old}{$new}g" "<>"
~/bin/s "$word"
xargs -0 -I '<>' "${dir}/r" "s{$old}{$new}g" "<>"
"${dir}/s" "$word"
#$(echo $new|tr A-Z a-z)