Skip to content

Commit

Permalink
filter out double slashes with sed
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan P.C. McQuen <[email protected]>
  • Loading branch information
Ryan P.C. McQuen committed Jun 4, 2015
1 parent 682cb3d commit e8403d8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions imgult
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,16 @@ if [ $# -eq 0 ]; then
set -- .
fi

## this is what we call leaning toothpick syndrome
## below we have leaning toothpick syndrome
## ...
## notice how the output is filtered with sed, in case
## the user feeds a directory using tab completion,
## leading to a trailing slash, and ergo, double slashes
find "$@" -type f -a \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.jpe' \
-o -iname '*.jfif' -o -iname '*.jif' -o -iname '*.jfi' -o -iname '*.thm' \
-o -iname '*.png' -o -iname '*.apng' -o -iname '*.mng' -o -iname '*.gif' \
-o -iname '*.svg' -o -iname '*.svgz' \) \
> imgult-files.txt
| sed 's@//@/@g' > imgult-files.txt

## back it up!
if [ "$BACKUPIMAGES" = true ]; then
Expand Down

0 comments on commit e8403d8

Please sign in to comment.