update sigpipe error fix in the doc

This commit is contained in:
Gokcehan committed 2021-02-06 00:19:09 +03:00
1 parent 9d451ffd19
commit 3e403bb888
3 files changed
+10 -26

No files matched your search

+4 -8
View File
@@ -1298,7 +1298,7 @@ match cleanly within a conditional:
*.rar) unrar l "$1";;
*.7z) 7z l "$1";;
*.pdf) pdftotext "$1" -;;
*) highlight -O ansi "$1" || cat "$1";;
*) highlight -O ansi "$1";;
esac
Another important consideration for efficiency is the use of programs with
@@ -1311,14 +1311,10 @@ script output pipe with a SIGPIPE when enough lines are read. When
everything else fails, you can make use of the height argument to only feed
the first portion of the file to a program for preview. Note that some
programs may not respond well to SIGPIPE to exit with a non-zero return code
and avoid caching. You may trap SIGPIPE in your preview script to avoid
error propogation:
and avoid caching. You may add a trailing '|| true' command to avoid such
errors:
#!/bin/sh
trap "" PIPE
...
highlight -O ansi "$1" || true
You may also use an existing preview filter as you like. Your system may
already come with a preview filter named 'lesspipe'. These filters may have