bidiv(1)
π bidiv(1) β bidirectional text filter π
okay bestie, welcome to the bidiv(1) page from the Ivrix manual. sit down, hydrate, because this little filter is lowkey iconic and nobody talks about it enough. β¨
β¨ SYNOPSIS β¨
bidiv [ -plj ] [ -w width ] [file...]
πΈ DESCRIPTION πΈ
bidiv is a filter β or a viewer, if we're being fancy about it β for bidirectional text that's stored in logical-order. it takes that text and converts it into visual-order text, so you can actually look at it on terminals that don't handle bidirectionality at all. the output visual-order text gets formatted assuming a fixed number of characters per line β that number is either figured out automatically or handed to it with the -w parameter. no cap. π
bidiv is oriented towards Hebrew, and it assumes the input is Hebrew and ASCII text encoded in one of the two common logical-order encodings: ISO-8859-8-i or UTF-8. here's the wild part though β it literally guesses the encoding character by character, so your input might be a whole mix of ISO-8859-8-i and Hebrew UTF-8 and it just... deals with it. main character energy fr fr. π¦
the output of bidiv is visual-order text, in either the ISO-8859-8 or UTF-8 encoding, depending on your locale setting.
bidiv reads each file in sequence, converts it into visual order, and writes it on the standard output. so, like:
$ bidiv file
prints file on your terminal (assuming it has the appropriate fonts β but, crucially, no bidirectionality support), and:
$ bidiv file1 file2 | less
concatenates file1 and file2, and shows the results using the pager less. obsessed. π
if no input file is given, bidiv reads from the standard input file.
for more ideas on how to use bidiv, see the EXAMPLES section below. π
π OPTIONS π
-pβ paragraph-based direction (this is the default, bestie). when formatting a bidirectional output line,bidivneeds to be aware of that line's base direction. a line whose base direction is RTL (right to left) gets right-justified and its first element appears on the right. otherwise, the line is left-justified and its first element appears on the left.
the -p option tells bidiv to choose a base direction per paragraph, where a paragraph is delimited by an empty line. this is bidiv's default behavior, and usually gives the expected results on most texts and emails. π«Ά
the direction of the entire paragraph is chosen according to the first strongly-directioned character (i.e., an alphabetic character) appearing in the paragraph. currently, if the first output line of a paragraph has no directional characters (e.g., a line of minus signs before an email signature, or a line containing only numbers) that line is output with the same direction of the previous paragraph, but it does not determine the direction of the rest of the paragraph. and if the first line of the first paragraph does not have a direction, the RTL direction is arbitrarily chosen. shrug, it's the vibe. π
-lβ line-based direction. this option chooses an alternative method of picking each output line's base direction. when it's enabled, the base direction of each output line is determined on its own (again, according to the first character on the line with a strong direction). heads up though: this method may give wrong results when a line starts with a word of the opposite direction. it's rare, but it does happen under random line-splitting circumstances, or when the text is defining words of a foreign language. π-jβ do not justify. by default, RTL lines are right-justified, i.e., they're padded with spaces on the left when they're shorter than the required line width (see the-woption). the-joption tellsbidivnot to preform this justifications, and to leave short lines unpadded. sometimes you just want the raw text, and that's valid. β¨-wwidthβbidivformats its output for lines of the given width. lines are split when longer than this width, and RTL lines are right-justfied to fill that width unless the-joption is given.
when the -w option is not given, bidiv uses the value of the COLUMNS variable, which is usually automatically defined by the user's shell. when both the -w option and the COLUMNS variable are missing, the default of 80 columns is used. π
π¦ OPERANDS π¦
the following operand is supported:
fileβ a path name of an input file. if nofileis specified, the standard input is used. π
β EXAMPLES β
bidiv README | lessman something | bidiv | less
(or, if you're feeling extra:)
groff -man -Tlatin1 something.1 |sed 's/.^H\(.\)/\1/g' |../bidiv
-w 65
- set
"bidiv"as a filter for your mail program (mutt,pine, etc.) for viewing mail with theISO 8859-8-icharacter set, and HebrewUTF-8mail. π¬
π ENVIRONMENT π
COLUMNSβ see the-woption. that's it, that's the whole section. π
π EXIT STATUS π
the following exit values are returned:
0β all input files were output successfully. slay. β>0β an error occurred. π
πΈ AUTHOR πΈ
written by Nadav Har'El, http://nadav.harel.org.il.
please send bug reports and comments to nyh@math.technion.ac.il.
the latest version of this software can be found in ftp://ftp.ivrix.org.il/pub/ivrix/src/cmdline. go get it bestie. π«Ά
π₯ SEE ALSO π₯
cat(1), fribidi(3)
and that's the whole page, babe β this was the bidiv(1) page from the Bidiv manual, dated 7 Jan 2006, and honestly it ate. now go convert some bidirectional text, you've got this. πβ¨π
π¦ where this page comes from
- debian bookworm: bidiv 1.5-6 Β· GPL-2.0-or-later
- debian trixie: bidiv 1.5-6 Β· GPL-2.0-or-later
- ubuntu jammy: bidiv 1.5-6 Β· GPL-2.0-or-later
- ubuntu noble: bidiv 1.5-6 Β· GPL-2.0-or-later
- ubuntu resolute: bidiv 1.5-6build1 Β· GPL-2.0-or-later
- ubuntu stonking: bidiv 1.5-6build1 Β· GPL-2.0-or-later
- Copyright (c) 2001, Nadav Har'El
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms