<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Linux Forum &mdash; "fuzzy search" на bash]]></title>
	<link rel="self" href="https://linuxforum.ru/extern.php?action=feed&amp;tid=37575&amp;type=atom" />
	<updated>2015-02-07T10:27:07Z</updated>
	<generator>PunBB</generator>
	<id>https://linuxforum.ru/viewtopic.php?id=37575</id>
		<entry>
			<title type="html"><![CDATA[Re: "fuzzy search" на bash]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=444588#p444588" />
			<content type="html"><![CDATA[<p>Добавлю еще вариант:<br /><div class="termtitle" style="font-family: sans-serif; position:relative; height:auto; width:auto; background:#3A4061; color:#FFFFFF; padding: 1px;"><b> Консоль:</b></div>
<div class="termcont" style="font-family: Terminus; position:relative; height:auto; width:auto; overflow-x:scroll; white-space: nowrap ; overflow-y:auto;background:#000000; color:#4EF44E; line-height:1.2; padding: 3px; font-size: 1rem; max-height: 60vh">xdg-open &quot;$(ls ~/files/ | rofi -dmenu)&quot;</div><br />ну или само <strong>dmenu</strong>, но оно мне не очень нравится.<br /><a href="https://davedavenport.github.io/rofi/">https://davedavenport.github.io/rofi/</a></p>]]></content>
			<author>
				<name><![CDATA[1000Mhz]]></name>
				<uri>https://linuxforum.ru/profile.php?id=35132</uri>
			</author>
			<updated>2015-02-07T10:27:07Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=444588#p444588</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: "fuzzy search" на bash]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=444224#p444224" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>1000Mhz пишет:</cite><blockquote><p>А вот чтобы реализовать п. 2 нужно как-то записать в переменную нажатие Alt+цифра, чтобы его можно было отловить далее. Тут я ффтупике.. впрочем, для &quot;порыться побыстрому&quot; в файлопомойке меня и так устраивает</p></blockquote></div><p>я думаю, возможностей read(1) вам не хватит.</p>]]></content>
			<author>
				<name><![CDATA[drBatty]]></name>
				<uri>https://linuxforum.ru/profile.php?id=86</uri>
			</author>
			<updated>2015-02-05T07:14:47Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=444224#p444224</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: "fuzzy search" на bash]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=443989#p443989" />
			<content type="html"><![CDATA[<p>Короче, рано наводить красоту. Чтобы <em>это</em> стало юзабельным, нужно: <br />1. когда число вариантов сократится до разумного минимума добавить нумерацию результатов (это легко) <br />2. заставить скрипт обрабатывать комбинацию клавиш Alt+цифра для быстрого открытия файла по номеру.<br />А вот чтобы реализовать п. 2 нужно как-то записать в переменную нажатие Alt+цифра, чтобы его можно было отловить далее. Тут я ффтупике.. впрочем, для &quot;порыться побыстрому&quot; в файлопомойке меня и так устраивает <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" /></p>]]></content>
			<author>
				<name><![CDATA[1000Mhz]]></name>
				<uri>https://linuxforum.ru/profile.php?id=35132</uri>
			</author>
			<updated>2015-02-03T16:39:10Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=443989#p443989</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: "fuzzy search" на bash]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=443963#p443963" />
			<content type="html"><![CDATA[<p>Косячок нашел: <br />read -n 1 -p &quot;$P&quot; <strong>-e</strong> IN<br />с опцией &quot;-е&quot; русский ввод игнорируется. Осталось вспомнить, на кой я ее туда зафигачил&nbsp; <img src="https://linuxforum.ru/img/smilies/ag.gif" alt="ag" /> </p><p><strong>drBatty</strong>, благодарю, на досуге подправлю. А fuzzy это не я, это гитхабовские умельцы так назвали))</p>]]></content>
			<author>
				<name><![CDATA[1000Mhz]]></name>
				<uri>https://linuxforum.ru/profile.php?id=35132</uri>
			</author>
			<updated>2015-02-03T14:07:27Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=443963#p443963</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: "fuzzy search" на bash]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=443961#p443961" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>1000Mhz пишет:</cite><blockquote><p>Как в скрипте обрабатывать нажатие Backspace не знаю,</p></blockquote></div><p><div class="termtitle" style="font-family: sans-serif; position:relative; height:auto; width:auto; background:#3A4061; color:#FFFFFF; padding: 1px;"><b> Консоль:</b></div>
<div class="termcont" style="font-family: Terminus; position:relative; height:auto; width:auto; overflow-x:scroll; white-space: nowrap ; overflow-y:auto;background:#000000; color:#4EF44E; line-height:1.2; padding: 3px; font-size: 1rem; max-height: 60vh">$ echo -e &quot;ABCDE\b\bXYZ&quot;<br />ABCXYZ<br /></div></p><div class="quotebox"><cite>1000Mhz пишет:</cite><blockquote><p> let n=${#P}-2 P=${P:0:$n}</p></blockquote></div><p><div class="termtitle" style="font-family: sans-serif; position:relative; height:auto; width:auto; background:#3A4061; color:#FFFFFF; padding: 1px;"><b> Консоль:</b></div>
<div class="termcont" style="font-family: Terminus; position:relative; height:auto; width:auto; overflow-x:scroll; white-space: nowrap ; overflow-y:auto;background:#000000; color:#4EF44E; line-height:1.2; padding: 3px; font-size: 1rem; max-height: 60vh">$ S=&quot;ABCDEF&quot;; echo &quot;${S::-2}&quot;<br />ABCD<br /></div></p><p>PS: годно, но к fuzzy отношения не имеет.</p>]]></content>
			<author>
				<name><![CDATA[drBatty]]></name>
				<uri>https://linuxforum.ru/profile.php?id=86</uri>
			</author>
			<updated>2015-02-03T13:59:47Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=443961#p443961</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: "fuzzy search" на bash]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=443960#p443960" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Vascom пишет:</cite><blockquote><p>Вместо ! -n лучше использовать -z.</p></blockquote></div><p>Да я handbook куда-то пролюбил, лепил по памяти.<br /></p><div class="quotebox"><cite>Vascom пишет:</cite><blockquote><p>Может добавишь комментариев?</p></blockquote></div><p>*занудным голосом* читаем символ со stdin, добавляем в переменную P, фильтруем вывод ls по переменной P, идем читать следующий, если &quot;-&quot; то удаляем последний символ. Т. е. классический поиск по мере набора. На Гитхабе такое есть (на python аж несколько проектов), но меня не устроило <s>т. к. на python</s> то кириллицу не отображает, то еще что-то через жо.</p>]]></content>
			<author>
				<name><![CDATA[1000Mhz]]></name>
				<uri>https://linuxforum.ru/profile.php?id=35132</uri>
			</author>
			<updated>2015-02-03T13:42:31Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=443960#p443960</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: "fuzzy search" на bash]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=443953#p443953" />
			<content type="html"><![CDATA[<p>Может добавишь комментариев?<br />Вместо ! -n лучше использовать -z.</p>]]></content>
			<author>
				<name><![CDATA[Vascom]]></name>
				<uri>https://linuxforum.ru/profile.php?id=5339</uri>
			</author>
			<updated>2015-02-03T13:21:19Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=443953#p443953</id>
		</entry>
		<entry>
			<title type="html"><![CDATA["fuzzy search" на bash]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=443923#p443923" />
			<content type="html"><![CDATA[<p>Поиск по файлопомойке&nbsp; <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" /> <br />Как в скрипте обрабатывать нажатие Backspace не знаю, поэтому за нее &quot;-&quot; (минус, дефис).</p><div class="codebox"><pre><code>P=&quot;&quot;
if [ ! -n &quot;$1&quot; ]
then dr=~
else dr=&quot;$1&quot;
fi
while read -n 1 -p &quot;$P&quot; -e IN
do
    P=$P$IN
    if [ &quot;$IN&quot; = &#039;-&#039; ]
    then 
        let n=${#P}-2
        P=${P:0:$n}
    fi
    clear
    ls  &quot;$dr&quot; | grep -i --color $P 2&gt;/dev/null || ( ls  &quot;$dr&quot;
    echo --- 0 Matches -----------------------------------)
done</code></pre></div>]]></content>
			<author>
				<name><![CDATA[1000Mhz]]></name>
				<uri>https://linuxforum.ru/profile.php?id=35132</uri>
			</author>
			<updated>2015-02-03T12:20:36Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=443923#p443923</id>
		</entry>
</feed>
