use -E instead of -r in sed

master
KatolaZ 6 years ago
parent fdeee8ccf2
commit 73eb9e6308
  1. 4
      gophed

@ -69,7 +69,7 @@ fi
if [ "$script_name" = "gophed" ] || [ "$script_name" = "v" ]; then
sel="$(printf '%s' "$1" | sed -r 's:/:+:g')"
sel="$(printf '%s' "$1" | sed -E 's:/:+:g')"
TMPFILE="$(mktemp "/tmp/gophed_${2}_${sel}_$3.XXXXXXXXXXXXXXXXXXX")"
goto_url "$1" > "$TMPFILE"
while read -r line; do echo "$line"; done | ed -p "$PROMPT" "$TMPFILE"
@ -84,7 +84,7 @@ if [ "$script_name" = "g" ] || [ "$script_name" = "d" ]; then
PORT="$(printf '%s' "$LINE" | awk -F ' ' '{ match($4,/[[:digit:]]+/); print substr($4,RSTART,RLENGTH) }')"
if [ "$script_name" = "g" ]; then
SEL="$(printf '%s' "$RESOURCE" | sed -r 's:/:+:g')"
SEL="$(printf '%s' "$RESOURCE" | sed -E 's:/:+:g')"
TMPFILE="$(mktemp "/tmp/gophed_${HOST}_${SEL}_$PORT.XXXXXXXXXXXXXXXXXXX")"
go "$RESOURCE" "$HOST" "$PORT" > "$TMPFILE"
while read -r line; do echo "$line"; done | ed -p "$PROMPT" "$TMPFILE"

Loading…
Cancel
Save