<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Linux Forum &mdash; Вывод имени файла из переменной в цикле for]]></title>
	<link rel="self" href="https://linuxforum.ru/extern.php?action=feed&amp;tid=29542&amp;type=atom" />
	<updated>2013-08-10T13:42:50Z</updated>
	<generator>PunBB</generator>
	<id>https://linuxforum.ru/viewtopic.php?id=29542</id>
		<entry>
			<title type="html"><![CDATA[Re: Вывод имени файла из переменной в цикле for]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=357711#p357711" />
			<content type="html"><![CDATA[<p>Обалдеть!!! Я 4 дня пытал гугл и яндекс запросами, а все оказывается так просто.<br />СПАСИБО БОЛЬШОЕ!!!</p>]]></content>
			<author>
				<name><![CDATA[remetlet]]></name>
				<uri>https://linuxforum.ru/profile.php?id=24510</uri>
			</author>
			<updated>2013-08-10T13:42:50Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=357711#p357711</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Вывод имени файла из переменной в цикле for]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=357650#p357650" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>a=&quot;/usr/local/scripts/test/var1&quot;
b=&quot;/usr/local/scripts/test/var2&quot;
c=&quot;/usr/local/scripts/test/var3&quot;
d=&quot;/usr/local/scripts/test/var4&quot;
for xen in &quot;$a&quot; &quot;$b&quot; &quot;$c&quot; &quot;$d&quot;
do
 if [ `cat &quot;$xen&quot;` -lt 4000 ]
 then echo &quot;*** &quot;$xen&quot; ***&quot;
 else echo &quot;++++++++++ &quot;$xen&quot; ++++++++++&quot;
 fi
done</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Lupo Alberto]]></name>
				<uri>https://linuxforum.ru/profile.php?id=9018</uri>
			</author>
			<updated>2013-08-10T05:08:52Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=357650#p357650</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Вывод имени файла из переменной в цикле for]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=357644#p357644" />
			<content type="html"><![CDATA[<p>Доброго времени суток,</p><p>возникла проблемка - пытался гуглить по всякому - ответа не нашел, прошу помощи.<br />Суть вопроса:</p><p>есть скрипт на bash(скрипт крайне упрощен, для наглядности, если понадобиться выложу рабочий, но сути он не меняет)</p><div class="codebox"><pre><code>a=`cat /usr/local/scripts/test/var1`
b=`cat /usr/local/scripts/test/var2`
c=`cat /usr/local/scripts/test/var3`
d=`cat /usr/local/scripts/test/var4`
for xen in &quot;$a&quot; &quot;$b&quot; &quot;$c&quot; &quot;$d&quot;
do
 if [ &quot;$xen&quot; -lt 4000 ]
 then echo &quot;*** &quot;$xen&quot; ***&quot;
 else echo &quot;++++++++++ &quot;$xen&quot; ++++++++++&quot;
 fi
done</code></pre></div><p>в данных файлах записаны просто цифры<br />var1 = 1000<br />var2 = 5000<br />var3 = 3000<br />var4 = 4500</p><p>мне необходимо в цикле for в echo вывести имя файла, из которого была получена переменная.<br />То есть вывод должен быть таким:</p><div class="codebox"><pre><code>*** var1 ***
++++++++++ var2 ++++++++++
*** var3 ***
++++++++++ var4 ++++++++++</code></pre></div>]]></content>
			<author>
				<name><![CDATA[remetlet]]></name>
				<uri>https://linuxforum.ru/profile.php?id=24510</uri>
			</author>
			<updated>2013-08-09T20:44:57Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=357644#p357644</id>
		</entry>
</feed>
