File: nourls

package info (click to toggle)
urlview 1e-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 276 kB
  • sloc: ansic: 876; cpp: 295; sh: 119; makefile: 82
file content (8 lines) | stat: -rwxr-xr-x 292 bytes parent folder | download
1
2
3
4
5
6
7
8
#!/bin/sh

trap 'rm -f "$tmpf"' EXIT INT
tmpf="$(mktemp)"

echo Random text | script -Enever -qec urlview /dev/null > "$tmpf"; err=$?
[ $err -eq 1 ] || echo "Exited $err, should 1" >&2
< "$tmpf" tr -d '\r' | grep -qFx 'No URLs found.' || { cat "$tmpf"; echo "'No URLs found.' missing"; } >&2