<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Linux Forum &mdash; Grep обратный поиск]]></title>
	<link rel="self" href="https://linuxforum.ru/extern.php?action=feed&amp;tid=24348&amp;type=atom" />
	<updated>2012-10-01T09:56:01Z</updated>
	<generator>PunBB</generator>
	<id>https://linuxforum.ru/viewtopic.php?id=24348</id>
		<entry>
			<title type="html"><![CDATA[Re: Grep обратный поиск]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=300914#p300914" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Asus_ROG пишет:</cite><blockquote><p>Нет, он на доске написал, что допустим в файле есть текст hello hello hello hello dlrow. При помощи grep надо найти в нем слово world и чтобы при выводе вышло только world, а не world olleh olleh olleh, получается что на уровне grep такого сделать не получится, пожалуйста помогите.</p></blockquote></div><div class="codebox"><pre><code>echo &quot;hello hello hello hello dlrow&quot; | rev | grep -o &#039;world&#039;
1:world</code></pre></div>]]></content>
			<author>
				<name><![CDATA[drBatty]]></name>
				<uri>https://linuxforum.ru/profile.php?id=86</uri>
			</author>
			<updated>2012-10-01T09:56:01Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=300914#p300914</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Grep обратный поиск]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=300063#p300063" />
			<content type="html"><![CDATA[<p><strong>-=Serj=-</strong><br />Спасибо!</p>]]></content>
			<author>
				<name><![CDATA[Asus_ROG]]></name>
				<uri>https://linuxforum.ru/profile.php?id=25630</uri>
			</author>
			<updated>2012-09-26T04:29:34Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=300063#p300063</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Grep обратный поиск]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=300014#p300014" />
			<content type="html"><![CDATA[<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">$ grep -o &quot;world\|dlrow&quot; 1.txt</div><br />или<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">$ grep -Eo &quot;world|dlrow&quot; 1.txt</div><br />или<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">$ egrep -o &quot;world|dlrow&quot; 1.txt</div></p>]]></content>
			<author>
				<name><![CDATA[-=Serj=-]]></name>
				<uri>https://linuxforum.ru/profile.php?id=16175</uri>
			</author>
			<updated>2012-09-25T15:52:52Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=300014#p300014</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Grep обратный поиск]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=299977#p299977" />
			<content type="html"><![CDATA[<p>Еще раз извиняюсь, а если у меня тот же файл 1.txt и в нем текст hello hello dlrow world, как сделать так чтобы grep вывел только world и dlrow, попробовал комманду grep -e &quot;world\|dlrow&quot; 1.txt, но вышла вся строка (hello hello dlrow world), так же пытался сделать так grep 1.txt &quot;world&amp;dlrow&quot; 1.txt результата не дало. Спасибо!</p>]]></content>
			<author>
				<name><![CDATA[Asus_ROG]]></name>
				<uri>https://linuxforum.ru/profile.php?id=25630</uri>
			</author>
			<updated>2012-09-25T11:13:20Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=299977#p299977</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Grep обратный поиск]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=299218#p299218" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>-=Serj=- пишет:</cite><blockquote><p>Не, а этот вариант-то попробовали - <a href="http://linuxforum.ru/viewtopic.php?pid=299201#p299201">Grep обратный пойск</a> ?</p></blockquote></div><p>Спасибо, помогло! То что и хотелось. <br />grep |rev &quot;world&quot; 1.txt, блин конечно изначально и не так близок был&nbsp; <img src="https://linuxforum.ru/img/smilies/ac.gif" alt="ac" />&nbsp; &nbsp;</p><p>[asus@mgt1 test]$ ls<br />1.txt<br />[asus@mgt1 test]$ tee&lt;1.txt<br />hello hello dlrow<br />[asus@mgt1 test]$ rev 1.txt | grep -o world<br />world<br />[asus@mgt1 test]$</p>]]></content>
			<author>
				<name><![CDATA[Asus_ROG]]></name>
				<uri>https://linuxforum.ru/profile.php?id=25630</uri>
			</author>
			<updated>2012-09-19T15:25:10Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=299218#p299218</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Grep обратный поиск]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=299213#p299213" />
			<content type="html"><![CDATA[<p>Не, а этот вариант-то попробовали - <a href="http://linuxforum.ru/viewtopic.php?pid=299201#p299201">Grep обратный пойск</a> ?</p>]]></content>
			<author>
				<name><![CDATA[-=Serj=-]]></name>
				<uri>https://linuxforum.ru/profile.php?id=16175</uri>
			</author>
			<updated>2012-09-19T15:12:47Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=299213#p299213</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Grep обратный поиск]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=299211#p299211" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Lupo Alberto пишет:</cite><blockquote><p>Может, всё же задание звучит так: найти в файле строки, содержащие «зеркальное» отображение шаблона?<br />Точнее, так его понимает преподаватель.</p></blockquote></div><p>Нет, он на доске написал, что допустим в файле есть текст hello hello hello hello dlrow. При помощи grep надо найти в нем слово world и чтобы при выводе вышло только world, а не world olleh olleh olleh, получается что на уровне grep такого сделать не получится, пожалуйста помогите.</p>]]></content>
			<author>
				<name><![CDATA[Asus_ROG]]></name>
				<uri>https://linuxforum.ru/profile.php?id=25630</uri>
			</author>
			<updated>2012-09-19T15:11:13Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=299211#p299211</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Grep обратный поиск]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=299204#p299204" />
			<content type="html"><![CDATA[<p>Может, всё же задание звучит так: найти в файле строки, содержащие «зеркальное» отображение шаблона?<br />Точнее, так его понимает преподаватель.</p>]]></content>
			<author>
				<name><![CDATA[Lupo Alberto]]></name>
				<uri>https://linuxforum.ru/profile.php?id=9018</uri>
			</author>
			<updated>2012-09-19T14:52:29Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=299204#p299204</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Grep обратный поиск]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=299202#p299202" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Lupo Alberto пишет:</cite><blockquote><div class="quotebox"><cite>Asus_ROG пишет:</cite><blockquote><p>search the content of file for random specified string (search should be performed in both directions)</p></blockquote></div><p>«Поиск по содержимому файла для случайно указанной строки (поиск должен осуществляться в обоих направлениях».<br />IMHO, звучит несколько иначе, чем...<br /></p><div class="quotebox"><cite>Asus_ROG пишет:</cite><blockquote><p>Как показал тьютор, нужно ввести в файл любые слова, но чтобы одно слово было зеркальным (apple&nbsp; elppa), сказал что нужно ввести команду grep и ввести слово apple, и чтобы в аутпуте вышло только apple.</p></blockquote></div></blockquote></div><p>Ну не знаю мне тьютор лично сказал как должно все получиться, но не сказал как все это реализовать, по-его словам единственный и верный способ это grep, но я ничего не нашел. Неужели нельзя что нибудь сделать в данном случае?</p>]]></content>
			<author>
				<name><![CDATA[Asus_ROG]]></name>
				<uri>https://linuxforum.ru/profile.php?id=25630</uri>
			</author>
			<updated>2012-09-19T14:51:51Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=299202#p299202</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Grep обратный поиск]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=299201#p299201" />
			<content type="html"><![CDATA[<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">$ rev 1.txt | grep -o world</div></p>]]></content>
			<author>
				<name><![CDATA[-=Serj=-]]></name>
				<uri>https://linuxforum.ru/profile.php?id=16175</uri>
			</author>
			<updated>2012-09-19T14:51:16Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=299201#p299201</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Grep обратный поиск]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=299197#p299197" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Asus_ROG пишет:</cite><blockquote><p>search the content of file for random specified string (search should be performed in both directions)</p></blockquote></div><p>«Поиск по содержимому файла для случайно указанной строки (поиск должен осуществляться в обоих направлениях».<br />IMHO, звучит несколько иначе, чем...<br /></p><div class="quotebox"><cite>Asus_ROG пишет:</cite><blockquote><p>Как показал тьютор, нужно ввести в файл любые слова, но чтобы одно слово было зеркальным (apple&nbsp; elppa), сказал что нужно ввести команду grep и ввести слово apple, и чтобы в аутпуте вышло только apple.</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[Lupo Alberto]]></name>
				<uri>https://linuxforum.ru/profile.php?id=9018</uri>
			</author>
			<updated>2012-09-19T14:45:20Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=299197#p299197</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Grep обратный поиск]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=299195#p299195" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>yars пишет:</cite><blockquote><div class="quotebox"><cite>Asus_ROG пишет:</cite><blockquote><div class="codebox"><pre><code>man grap &quot;world&quot; 1.txt
No manual entry for grap
No manual entry for world
No manual entry for 1.txt</code></pre></div></blockquote></div><p>А почему вы уверены, что <em>man</em> знает команду <em>gr<strong>a</strong>p</em>, слово <em>world</em> и ваш файл 1.txt?<br />UPD: <span style="color: red"><em>Lupo Alberto</em></span>, вы меня опередили <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" /></p></blockquote></div><p>Ну я думал что man это как префикс типа ls -a и т.д.</p>]]></content>
			<author>
				<name><![CDATA[Asus_ROG]]></name>
				<uri>https://linuxforum.ru/profile.php?id=25630</uri>
			</author>
			<updated>2012-09-19T14:42:07Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=299195#p299195</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Grep обратный поиск]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=299194#p299194" />
			<content type="html"><![CDATA[<p>Вот само задание: search the content of file for random specified string (search should be performed in both directions)</p><p>Как показал тьютор, нужно ввести в файл любые слова, но чтобы одно слово было зеркальным (apple&nbsp; elppa), сказал что нужно ввести команду grep и ввести слово apple, и чтобы в аутпуте вышло только apple.<br /><strong>-=Serj=-</strong><br />Тоже самое у меня вышло первом посте world olleh olleh, но тьютор сказал так нельзя, нужно чтобы вышло только world.</p>]]></content>
			<author>
				<name><![CDATA[Asus_ROG]]></name>
				<uri>https://linuxforum.ru/profile.php?id=25630</uri>
			</author>
			<updated>2012-09-19T14:40:40Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=299194#p299194</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Grep обратный поиск]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=299192#p299192" />
			<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">$ cat 1.txt<br />abra cadabra<br />прсто строка<br />hello hello dlrow<br />$ grep dlrow 1.txt | rev<br />world olleh olleh</div></p><p>ЗЫ. А, не... нужно только первое слово...</p>]]></content>
			<author>
				<name><![CDATA[-=Serj=-]]></name>
				<uri>https://linuxforum.ru/profile.php?id=16175</uri>
			</author>
			<updated>2012-09-19T14:35:19Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=299192#p299192</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Grep обратный поиск]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=299191#p299191" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Asus_ROG пишет:</cite><blockquote><div class="codebox"><pre><code>man grap &quot;world&quot; 1.txt
No manual entry for grap
No manual entry for world
No manual entry for 1.txt</code></pre></div></blockquote></div><p>А почему вы уверены, что <em>man</em> знает команду <em>gr<strong>a</strong>p</em>, слово <em>world</em> и ваш файл 1.txt?<br />UPD: <span style="color: red"><em>Lupo Alberto</em></span>, вы меня опередили <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" /></p>]]></content>
			<author>
				<name><![CDATA[yars]]></name>
				<uri>https://linuxforum.ru/profile.php?id=22799</uri>
			</author>
			<updated>2012-09-19T14:11:18Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=299191#p299191</id>
		</entry>
</feed>
