<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-3313530259099615004.post2142387530038432860..comments</id><updated>2008-02-17T07:18:53.449-06:00</updated><title type='text'>Comments on clipboarded: command line quizzes part 2</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://clipboarded.blogspot.com/feeds/2142387530038432860/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3313530259099615004/2142387530038432860/comments/default'/><link rel='alternate' type='text/html' href='http://clipboarded.blogspot.com/2008/02/command-line-quizzes-part-2.html'/><author><name>mats</name><uri>http://www.blogger.com/profile/09415156435863824246</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3313530259099615004.post-7724412748044508237</id><published>2008-02-17T07:18:00.000-06:00</published><updated>2008-02-17T07:18:00.000-06:00</updated><title type='text'>Hi mats, you're right, I shouldn't have been check...</title><content type='html'>Hi mats, you're right, I shouldn't have been checking to see they define the same set.&lt;BR/&gt;&lt;BR/&gt;So I'd change the "cmp -s" for "comm -12", drop the "|| echo..." bit, and leave everything else the same.  That will list those that are duplicates.&lt;BR/&gt;&lt;BR/&gt;Cheers, Ralph Corderoy.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3313530259099615004/2142387530038432860/comments/default/7724412748044508237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3313530259099615004/2142387530038432860/comments/default/7724412748044508237'/><link rel='alternate' type='text/html' href='http://clipboarded.blogspot.com/2008/02/command-line-quizzes-part-2.html?showComment=1203254280000#c7724412748044508237' title=''/><author><name>Ralph</name><uri>http://www.blogger.com/profile/13140975971019765573</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://clipboarded.blogspot.com/2008/02/command-line-quizzes-part-2.html' ref='tag:blogger.com,1999:blog-3313530259099615004.post-2142387530038432860' source='http://www.blogger.com/feeds/3313530259099615004/posts/default/2142387530038432860' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3313530259099615004.post-5671563007362898281</id><published>2008-02-16T16:45:00.000-06:00</published><updated>2008-02-16T16:45:00.000-06:00</updated><title type='text'>Hey Ralph,The idea is to find out if a class is de...</title><content type='html'>Hey Ralph,&lt;BR/&gt;The idea is to find out if a class is defined in multiple places. I think your solution would almost always say the two files differ, which isn't helpful. Of course the wording of the question was ambiguous so I changed it.&lt;BR/&gt;&lt;BR/&gt;Also, it's hard to know whether or not defining a class twice in the same file is a mistake. Sometimes it is, sometimes it's not, which is why I grep the files and display the results so the user knows where were the duplicates.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3313530259099615004/2142387530038432860/comments/default/5671563007362898281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3313530259099615004/2142387530038432860/comments/default/5671563007362898281'/><link rel='alternate' type='text/html' href='http://clipboarded.blogspot.com/2008/02/command-line-quizzes-part-2.html?showComment=1203201900000#c5671563007362898281' title=''/><author><name>mats</name><uri>http://www.blogger.com/profile/09415156435863824246</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12753336799386138858'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://clipboarded.blogspot.com/2008/02/command-line-quizzes-part-2.html' ref='tag:blogger.com,1999:blog-3313530259099615004.post-2142387530038432860' source='http://www.blogger.com/feeds/3313530259099615004/posts/default/2142387530038432860' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3313530259099615004.post-1619334209727162266</id><published>2008-02-16T08:57:00.000-06:00</published><updated>2008-02-16T08:57:00.000-06:00</updated><title type='text'>I don't know CSS-syntax precisely but here's a sta...</title><content type='html'>I don't know CSS-syntax precisely but here's a stab based on stripping everything after the open brace.&lt;BR/&gt;&lt;BR/&gt;$ classnames() { sed 's/{.*//; y/ /\n/' "$@" | grep '^\.' | sort -u; }&lt;BR/&gt;$ classnames &amp;lt;first.css&lt;BR/&gt;.article&lt;BR/&gt;.footer&lt;BR/&gt;.header&lt;BR/&gt;.left&lt;BR/&gt;.main&lt;BR/&gt;$&lt;BR/&gt;&lt;BR/&gt;$ cmp -s &amp;lt;(classnames first.css) &amp;lt;(classnames first.css) || echo they differ&lt;BR/&gt;$ cmp -s &amp;lt;(classnames first.css) &amp;lt;(classnames second.css) || echo they differ&lt;BR/&gt;they differ&lt;BR/&gt;$&lt;BR/&gt;&lt;BR/&gt;The question was if the two define the same classes.  The same class being defined more than once in the same file is presumably not a problem but I think the original will treat it as an error.&lt;BR/&gt;&lt;BR/&gt;Cheers, Ralph Corderoy.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3313530259099615004/2142387530038432860/comments/default/1619334209727162266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3313530259099615004/2142387530038432860/comments/default/1619334209727162266'/><link rel='alternate' type='text/html' href='http://clipboarded.blogspot.com/2008/02/command-line-quizzes-part-2.html?showComment=1203173820000#c1619334209727162266' title=''/><author><name>Ralph</name><uri>http://www.blogger.com/profile/13140975971019765573</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://clipboarded.blogspot.com/2008/02/command-line-quizzes-part-2.html' ref='tag:blogger.com,1999:blog-3313530259099615004.post-2142387530038432860' source='http://www.blogger.com/feeds/3313530259099615004/posts/default/2142387530038432860' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3313530259099615004.post-2531061151353541127</id><published>2008-02-15T17:52:00.000-06:00</published><updated>2008-02-15T17:52:00.000-06:00</updated><title type='text'>You're absolutely right. I changed the main post w...</title><content type='html'>You're absolutely right. I changed the main post with your version.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3313530259099615004/2142387530038432860/comments/default/2531061151353541127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3313530259099615004/2142387530038432860/comments/default/2531061151353541127'/><link rel='alternate' type='text/html' href='http://clipboarded.blogspot.com/2008/02/command-line-quizzes-part-2.html?showComment=1203119520000#c2531061151353541127' title=''/><author><name>mats</name><uri>http://www.blogger.com/profile/09415156435863824246</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12753336799386138858'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://clipboarded.blogspot.com/2008/02/command-line-quizzes-part-2.html' ref='tag:blogger.com,1999:blog-3313530259099615004.post-2142387530038432860' source='http://www.blogger.com/feeds/3313530259099615004/posts/default/2142387530038432860' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3313530259099615004.post-6811173656708354710</id><published>2008-02-15T08:54:00.000-06:00</published><updated>2008-02-15T08:54:00.000-06:00</updated><title type='text'>For the first one,top -b -n 1 | awk 'NR &gt;= 8 &amp;&amp; $9...</title><content type='html'>For the first one,&lt;BR/&gt;&lt;BR/&gt;top -b -n 1 | awk 'NR &gt;= 8 &amp;&amp; $9 &gt; 25 {print $1}' | xargs -r kill&lt;BR/&gt;&lt;BR/&gt;Why do you use xargs?  It's doing nothing useful in your version.  Idiomatic awk scripts make use of the `pattern action' style of programming.  tail was redundant given it was being used to skip lines at the start and awk can do that simply.  xargs's -r option stops kill from given the usage message.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3313530259099615004/2142387530038432860/comments/default/6811173656708354710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3313530259099615004/2142387530038432860/comments/default/6811173656708354710'/><link rel='alternate' type='text/html' href='http://clipboarded.blogspot.com/2008/02/command-line-quizzes-part-2.html?showComment=1203087240000#c6811173656708354710' title=''/><author><name>Ralph</name><uri>http://www.blogger.com/profile/13140975971019765573</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://clipboarded.blogspot.com/2008/02/command-line-quizzes-part-2.html' ref='tag:blogger.com,1999:blog-3313530259099615004.post-2142387530038432860' source='http://www.blogger.com/feeds/3313530259099615004/posts/default/2142387530038432860' type='text/html'/></entry></feed>