Skip to content

Commit

Permalink
Standardize sed usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Monty committed Feb 7, 2021
1 parent 515ab6b commit 4cd724f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions createFilmography.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ while read -r line; do
count=$(cut -f 1 <<<"$line")
match=$(cut -f 2 <<<"$line")
if [ "$count" -eq 1 ]; then
rg "\t$match\t" "$POSSIBLE_MATCHES" | sed -e 's+^+imdb.com/name/+' \
rg "\t$match\t" "$POSSIBLE_MATCHES" | sed 's+^+imdb.com/name/+' \
>>"$PERSON_RESULTS"
continue
fi
Expand Down Expand Up @@ -254,7 +254,7 @@ else
fi

# Get rid of the URL preface we added
sed -i -e s+imdb.com/name/++ "$PERSON_RESULTS"
sed -i '' 's+imdb.com/name/++' "$PERSON_RESULTS"

if ! waitUntil "$YN_PREF" -Y; then
loopOrExitP
Expand Down
4 changes: 2 additions & 2 deletions createTconstFile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ while read -r line; do
count=$(cut -f 1 <<<"$line")
match=$(cut -f 2 <<<"$line")
if [ "$count" -eq 1 ]; then
rg "\t$match\t" "$POSSIBLE_MATCHES" | sed -e 's+^+imdb.com/title/+' \
rg "\t$match\t" "$POSSIBLE_MATCHES" | sed 's+^+imdb.com/title/+' \
>>"$FINAL_RESULTS"
continue
fi
Expand Down Expand Up @@ -253,7 +253,7 @@ else
fi

# Get rid of the URL preface we added
sed -i -e s+imdb.com/title/++ "$FINAL_RESULTS"
sed -i '' 's+imdb.com/title/++' "$FINAL_RESULTS"

# Do we want to add it?
addToFileP
Expand Down
4 changes: 2 additions & 2 deletions findPeopleInShows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ while read -r line; do
count=$(cut -f 1 <<<"$line")
match=$(cut -f 2 <<<"$line")
if [ "$count" -eq 1 ]; then
rg "\t$match\t" "$POSSIBLE_MATCHES" | sed -e 's+^+imdb.com/title/+' \
rg "\t$match\t" "$POSSIBLE_MATCHES" | sed 's+^+imdb.com/title/+' \
>>"$ALL_MATCHES"
continue
fi
Expand Down Expand Up @@ -272,7 +272,7 @@ fi
printf "\n"

# Get rid of the URL we added
sed -i -e s+imdb.com/title/++ "$ALL_MATCHES"
sed -i '' 's+imdb.com/title/++' "$ALL_MATCHES"

# Figure out which tconst IDs are cached and which aren't
ls -1 "$cacheDirectory" | rg "^tt" >"$CACHE_LIST"
Expand Down
4 changes: 2 additions & 2 deletions findShowsWith.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ while read -r line; do
count=$(cut -f 1 <<<"$line")
match=$(cut -f 2 <<<"$line")
if [ "$count" -eq 1 ]; then
rg "\t$match\t" "$POSSIBLE_MATCHES" | sed -e 's+^+imdb.com/name/+' \
rg "\t$match\t" "$POSSIBLE_MATCHES" | sed 's+^+imdb.com/name/+' \
>>"$PERSON_RESULTS"
continue
fi
Expand Down Expand Up @@ -238,7 +238,7 @@ else
fi

# Get rid of the URL preface we added
sed -i -e s+imdb.com/name/++ "$PERSON_RESULTS"
sed -i '' 's+imdb.com/name/++' "$PERSON_RESULTS"

if ! waitUntil "$YN_PREF" -Y; then
loopOrExitP
Expand Down
2 changes: 1 addition & 1 deletion generateXrefData.sh
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ function checkdiffs() {
# first the stats
diff -c "$1" "$2" | diffstat -sq \
-D "$(cd "$(dirname "$2")" && pwd -P)" |
sed -e "s+ 1 file changed,+==>+" -e "s+([+-=\!])++g"
sed -e 's+ 1 file changed,+==>+' -e 's+([+-=\!])++g'
# then the diffs
diff \
--unchanged-group-format='' \
Expand Down
2 changes: 1 addition & 1 deletion xrefCast.sh
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ done
cat "$SEARCH_TERMS"

# Escape metacharacters known to appear in titles, persons, characters
sed -i 's/[()?]/\\&/g' "$SEARCH_TERMS"
sed -i '' 's+[()?]+\\&+g' "$SEARCH_TERMS"

# Setup awk printf formats with spaces or tabs
# Name|Job|Show|Episode|Role
Expand Down

0 comments on commit 4cd724f

Please sign in to comment.