<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Hilfe beim Shellscripten mit awk]]></title><description><![CDATA[<p>Also zuallererst folgendes:<br />
Ich versuche die ausgabe vom gcc so zu verändern, dass aus den zeilennummern, die in doppelpunkten eingeschlossen sind, geklammerte werte werden, sodass VisualStudio die dateien samt zeile in der Fehlerliste anzeigen kann.</p>
<p>In einer interaktiven shell kann ich zum Beispiel folgendes benutzen:</p>
<pre><code>echo abc.c:12:8: error: Invalid bla | awk '{ print gensub(/:(&lsqb;&lsqb;:digit:&rsqb;&rsqb;+):(|(&lsqb;&lsqb;:digit:&rsqb;&rsqb;+):)/, &quot;(\\1, \\3)&quot;, &quot;g&quot;); }
</code></pre>
<p>was das format der ausgabe umwandelt.<br />
Wenn ich nun aber dasselbe in einem shellscript versuche tut sich nichts:</p>
<pre><code>$CC -o stdafx.h.gch stdafx.h | awk '{ print gensub(/:(&lsqb;&lsqb;:digit:&rsqb;&rsqb;+):(|(&lsqb;&lsqb;:digit:&rsqb;&rsqb;+):)/, &quot;(\\1, \\3)&quot;, &quot;g&quot;); }'
</code></pre>
<p>Nun frage ich mich wo liegt der fehler?<br />
Vielen dank für tatkräftige hilfe.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/223136/hilfe-beim-shellscripten-mit-awk</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Apr 2026 02:40:14 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/223136.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 22 Sep 2008 19:08:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hilfe beim Shellscripten mit awk on Mon, 22 Sep 2008 19:08:11 GMT]]></title><description><![CDATA[<p>Also zuallererst folgendes:<br />
Ich versuche die ausgabe vom gcc so zu verändern, dass aus den zeilennummern, die in doppelpunkten eingeschlossen sind, geklammerte werte werden, sodass VisualStudio die dateien samt zeile in der Fehlerliste anzeigen kann.</p>
<p>In einer interaktiven shell kann ich zum Beispiel folgendes benutzen:</p>
<pre><code>echo abc.c:12:8: error: Invalid bla | awk '{ print gensub(/:(&lsqb;&lsqb;:digit:&rsqb;&rsqb;+):(|(&lsqb;&lsqb;:digit:&rsqb;&rsqb;+):)/, &quot;(\\1, \\3)&quot;, &quot;g&quot;); }
</code></pre>
<p>was das format der ausgabe umwandelt.<br />
Wenn ich nun aber dasselbe in einem shellscript versuche tut sich nichts:</p>
<pre><code>$CC -o stdafx.h.gch stdafx.h | awk '{ print gensub(/:(&lsqb;&lsqb;:digit:&rsqb;&rsqb;+):(|(&lsqb;&lsqb;:digit:&rsqb;&rsqb;+):)/, &quot;(\\1, \\3)&quot;, &quot;g&quot;); }'
</code></pre>
<p>Nun frage ich mich wo liegt der fehler?<br />
Vielen dank für tatkräftige hilfe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1586180</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1586180</guid><dc:creator><![CDATA[wurstikus]]></dc:creator><pubDate>Mon, 22 Sep 2008 19:08:11 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe beim Shellscripten mit awk on Mon, 22 Sep 2008 20:14:45 GMT]]></title><description><![CDATA[<p>Vmtl. wird das nicht an die Standardausgabe sondern an cerr oä ausgegeben, Du pipest aber nur die Standardausgabe weiter.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1586194</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1586194</guid><dc:creator><![CDATA[nman]]></dc:creator><pubDate>Mon, 22 Sep 2008 20:14:45 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe beim Shellscripten mit awk on Mon, 22 Sep 2008 20:26:34 GMT]]></title><description><![CDATA[<p>genau das wars, und ließ sich mit einem 2&gt;&amp;1 vor dem pipe-operator beheben.<br />
Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1586198</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1586198</guid><dc:creator><![CDATA[wurstikius]]></dc:creator><pubDate>Mon, 22 Sep 2008 20:26:34 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe beim Shellscripten mit awk on Tue, 23 Sep 2008 10:42:33 GMT]]></title><description><![CDATA[<p>Jetzt hab ich ein neues problem: Ich versuch mithilfe von variablen diese lange zeile in meinem script zu vermeinden, das sieht in etwa so aus:</p>
<pre><code># AWK aufruf wird zerpflückt
AWK=&quot;/bin/awk '{ print gensub(/:(&lsqb;&lsqb;:digit:&rsqb;&rsqb;+):(|(&lsqb;&lsqb;:digit:&rsqb;&rsqb;+):)/, \&quot;(\\\\1, \\\\3)\&quot;, \&quot;g\&quot;); }'&quot;

$CC -o stdafx.h.gch stdafx.h 2&gt;&amp;1 | ${AWK}
# AWK aufruf wird als eine datei, die nicht auffindbar ist interpretiert
$CC -o stdafx.h.gch stdafx.h 2&gt;&amp;1 | &quot;${AWK}&quot;
</code></pre>
<p>Nun ist meine frage, was ich machen muss, dass nach der expansion awk mit einem durchgängigen parameter dasteht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1586425</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1586425</guid><dc:creator><![CDATA[rgsgreg]]></dc:creator><pubDate>Tue, 23 Sep 2008 10:42:33 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe beim Shellscripten mit awk on Tue, 23 Sep 2008 10:45:55 GMT]]></title><description><![CDATA[<p>jetzt habe ich das behelfsmäßig so gelöst:</p>
<pre><code>AWK='{ print gensub(/:(&lsqb;&lsqb;:digit:&rsqb;&rsqb;+):(|(&lsqb;&lsqb;:digit:&rsqb;&rsqb;+):)/, &quot;(\\1, \\3):&quot;, &quot;g&quot;); }'
$CC -o stdafx.h.gch stdafx.h 2&gt;&amp;1 | awk &quot;${AWK}&quot;
</code></pre>
<p>falls jemand weiß, wie es besser geht bin ich für antworten dankbar.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1586433</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1586433</guid><dc:creator><![CDATA[rgeg]]></dc:creator><pubDate>Tue, 23 Sep 2008 10:45:55 GMT</pubDate></item></channel></rss>