<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Wanderwort by Roman Ernst &#187; Mac OS</title>
	<atom:link href="http://wanderwort.de/tag/mac-os/feed/" rel="self" type="application/rss+xml" />
	<link>http://wanderwort.de</link>
	<description>Interkulturelle Wortkolletionen in Ruby, PHP, XHTML, CSS nah am Strom der Gesellschaft</description>
	<lastBuildDate>Mon, 14 Mar 2011 15:10:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Iterate over Associative Arrays in Bash</title>
		<link>http://wanderwort.de/2010/06/24/iterate-over-assoziative-arrays-in-bash/</link>
		<comments>http://wanderwort.de/2010/06/24/iterate-over-assoziative-arrays-in-bash/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 19:59:23 +0000</pubDate>
		<dc:creator>pex</dc:creator>
				<category><![CDATA[Gemachtes]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Mac OS]]></category>

		<guid isPermaLink="false">http://wanderwort.de/?p=299</guid>
		<description><![CDATA[Probably because many people think Bash is outdated it&#8217;s that hard to find proper resources digging into this Shell. Now we&#8217;ll have a look at an associative array and use each key to rename a file defined in value one got via wget. Beware: Take a look at the OS X issues at the end [...]]]></description>
			<content:encoded><![CDATA[<p>Probably because many people think Bash is outdated it&#8217;s that hard to find proper resources digging into this Shell. Now we&#8217;ll have a look at an <a href="http://en.wikipedia.org/wiki/Associative_array">associative array</a> and use each <em>key</em> to rename a file defined in <em>value</em> one got via <a href="http://en.wikipedia.org/wiki/Wget">wget</a>.</p>
<p><b style="color: red">Beware</b>: Take a look at the OS X issues at the end of this article if working on a Mac!</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #7a0874; font-weight: bold;">unset</span> array; <span style="color: #7a0874; font-weight: bold;">declare</span> <span style="color: #660033;">-A</span> array <span style="color: #666666; font-style: italic;"># the -A attributes stands for associative</span>
&nbsp;
array<span style="color: #7a0874; font-weight: bold;">&#91;</span>foo<span style="color: #7a0874; font-weight: bold;">&#93;</span>=bar
array<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;spaced string&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>=<span style="color: #ff0000;">&quot;foo bar&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #800000;">${!array[@]}</span>
<span style="color: #000000; font-weight: bold;">do</span>
  <span style="color: #666666; font-style: italic;"># do something</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>This is how an iteration could look like. Have a look at <a href="http://wiki.bash-hackers.org/syntax/arrays">bash-hackers.org</a> to get more information. Thanks to <a href="http://blog.denniswilliamson.us/">Dennis Williamson</a> solving <a href="http://stackoverflow.com/questions/3112687/how-to-iterate-over-assoziative-array-in-bash">this topic</a>.</p>
<p>To get a file from the given URL perform the following command in the loop:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${array[$i]}</span>&quot;</span> <span style="color: #660033;">-O</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${i}</span>.jpg&quot;</span></pre></div></div>

<p>The attribute <em>-O</em> renames the file.</p>
<p>Using variables outside Strings obviate the need for curly brackets so that $i would work as well.<br />
<b>Go on reading if you&#8217;re using a Mac:</b><br />
<span id="more-299"></span><br />
<b>Mac OS X Issues</b><br />
The given example and associative arrays in bash require a Bash version greater than 4.0. OS X (Leopard) gets shipped with version 3.2.48(1). So we either have to install a newer Bash Version manually <a href="http://concisionandconcinnity.blogspot.com/2009/03/upgrade-bash-to-40-in-mac-os-x.html">as described by Ian McCracken</a> or use a package installer like <a href="http://www.finkproject.org/">Fink</a>, <a href="http://www.macports.org/">MacPorts</a> or <a href="http://mxcl.github.com/homebrew/">Homebrew</a>. As I am a Homebrew fanboy, here&#8217;s how to brew it:</p>
<p><b>Installing Bash > 4.0 with Homebrew</b></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ brew <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">bash</span> <span style="color: #666666; font-style: italic;"># definitely gets a newer version than 4.0:</span>
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">bash</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;echo /usr/local/Cellar/bash/%INSTALLED_VERSION%/bin/bash &gt;&gt; /private/etc/shells&quot;</span> <span style="color: #666666; font-style: italic;"># register the new Bash as a valid Shell</span>
$ <span style="color: #c20cb9; font-weight: bold;">chsh</span> <span style="color: #666666; font-style: italic;"># use the new Shell for your user</span></pre></div></div>

<p>In the chsh file you simply enter the path you&#8217;ve installed and registered the shell to.</p>
<p>You might also have to install wget because Mac OS comes without this handy tool as well:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ brew <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">wget</span></pre></div></div>

<p><b style="color: red">IMPORTANT:</b><br />
In your scripts you also have to define the new path of Bash! E.g:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/local/Cellar/bash/%INSTALLED_VERSION%/bin/bash</span>
&nbsp;
some_bash_code</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://wanderwort.de/2010/06/24/iterate-over-assoziative-arrays-in-bash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Meine Neue und ihre Zicken</title>
		<link>http://wanderwort.de/2007/11/15/meine-neue-und-ihre-zicken/</link>
		<comments>http://wanderwort.de/2007/11/15/meine-neue-und-ihre-zicken/#comments</comments>
		<pubDate>Thu, 15 Nov 2007 15:20:30 +0000</pubDate>
		<dc:creator>pex</dc:creator>
				<category><![CDATA[Gemischtes]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[Mac OS]]></category>

		<guid isPermaLink="false">http://wanderwort.de/2007/11/15/meine-neue-und-ihre-zicken/</guid>
		<description><![CDATA[Silvia hab&#8217; ich einen Laufpass gegeben und nun ist Jana aktuell. So weit, dass ich meinen Rechnern Frauennamen gebe, ist es zwar noch nicht, doch bei einem MacBook Pro ist man vor absoluter Entzückung nicht gefeit. So habe ich gleich Leopard eingeweiht und festgestellt, dass es doch einige Sachen gibt, die nicht laufen auf Apples [...]]]></description>
			<content:encoded><![CDATA[<p>Silvia hab&#8217; ich einen Laufpass gegeben und nun ist Jana aktuell.<br />
So weit, dass ich meinen Rechnern Frauennamen gebe, ist es zwar noch nicht, doch bei einem MacBook Pro ist man vor absoluter Entzückung nicht gefeit. So habe ich gleich Leopard eingeweiht und festgestellt, dass es doch einige Sachen gibt, die nicht laufen auf Apples neuestem Schuss.</p>
<h2>1. Skype</h2>
<p>Nach der normalen Installation starten Skype genau ein mal. Danach hüpft das Symbol im Dock nur einmal und es passiert nicht. Erst Verzweiflung, dann folgende Lösung:</p>
<p>Ihr müsst Skype installieren, aber noch nicht starten. In Programmen/Skype sich den Paketinhalt anzeigen lassen und die Informationen (Apfel+I) der Ordner &#8220;MacOS&#8221; und &#8220;Contents&#8221; sowie die Datei &#8220;Skype&#8221; aufrufen. Bei &#8220;Sharing-und Zugriffsrechte&#8221; stellt ihr nun bei &#8220;Ich&#8221; auf &#8220;Nur lesen&#8221;. Fenster schließen und wieder öffnen, dann ein Häkchen bei &#8220;Geschützt&#8221;. Schliessen und Skype öffnen &#8211; fertig.<br />
-> <a href="http://www.maclife.de/index.php?name=PNphpBB2&#038;file=viewtopic&#038;p=613684&#038;sid=f911450228b7dede5b931cbb8c3a2723#613684">Quelle</a></p>
<p>Nachtrag:<br />
Nach der neusten Skype Version scheint sich das Problem amortisiert zu haben. Außerdem kann man dem Programm den dauerhaften Zugriff zum Netz gestatten, was den blöden Klick nach jedem Neustart auch behebt.</p>
<h2>2. Last.fm</h2>
<p>Der Audioscrobbler von Last.fm macht sich durch eine viel zu hohe Speicherauslastung bemerkbar. Ich habe noch nichts gefunden, was das behebt. Entsprechend rate ich mit <a href="http://www.gimmesometune.com/">GimmeSomeTune</a> zu scrobblen.</p>
<h2>3. Die neuen Sicherheitswarnungen bei Mail und Programmstarts</h2>
<p>.. die wirklich nerven! Sobald ich eine Möglichkeit gefunden habe, bei Zugriff auf POP-Accaunts mit nicht erkanntem Zertifikaten die Warnungen auszuschalten, bin ich wirklich froh. Manchen Programmen muss man auch ständig neu erlauben, sich mit dem Internet zu verbinden. Ich hoffe, dass Apple da mit 10.5.1 ein wenig aufräumt.</p>
<p>Aber ansonsten ist es ein gelungenen Betriebssystem, dass trotz des protzigen Erscheinungsbildes sauber und schnell arbeitet. Meine Wünsche für die Zukunft beschränken sich im Moment auf hübschere Ordner- und Stacksymbole, sowie einer Ausbesserung der Firewall.</p>
<p>Zum Schluss noch einmal meine ersten Minuten mit dem neuen MacBook Pro (Jana?):<br />
<span id="more-8"></span></p>
<p><img src="http://farm3.static.flickr.com/2012/2034366076_b0e6a05a2a.jpg?v=0" alt="Target Connection between iMac G5 and MacBoom Pro" /><br />
<img src="http://farm3.static.flickr.com/2309/2034366070_ef53cbb900.jpg?v=0" alt="Installing Windows on a MacBook Pro" /></p>
<p>Auf letzterem Bild installiere ich übrigens Windows XP. Das sollte mir nochmal zum Verhängnis werden, als ich verwöhnt von MacOS X einfach ohne viel zu denken durch die Systemabfragen klickte. Plötzlich hatte Windows mir nämlich die ganze vorher eingerichtete Platte formatiert. Vielen Dank Bill Gates für dieses super Betriebssystem!<br />
Darauf folgte dann (wieder) ersteres Bild, auf dem ich im Target Modus mit einem FireFire Kabel eine Datensicherung mache.</p>
]]></content:encoded>
			<wfw:commentRss>http://wanderwort.de/2007/11/15/meine-neue-und-ihre-zicken/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Der erste Eindruck zählt</title>
		<link>http://wanderwort.de/2007/10/26/der-erste-eindruck-zahlt/</link>
		<comments>http://wanderwort.de/2007/10/26/der-erste-eindruck-zahlt/#comments</comments>
		<pubDate>Fri, 26 Oct 2007 16:50:34 +0000</pubDate>
		<dc:creator>pex</dc:creator>
				<category><![CDATA[Gemischtes]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[Mac OS]]></category>

		<guid isPermaLink="false">http://wanderwort.de/2007/10/26/der-erste-eindruck-zahlt/</guid>
		<description><![CDATA[.. und der ist überwältigend. Mac OS 10.5 Leopard mit Becks und Fingerfood. Jedenfalls hat mein Applehändler vor der Tür, nachdem er heute um 18:00 Uhr das zweite Mal öffnete guten Umsatz mit dem neuen Betriebssystem von Apple gemacht. Und ganz verrückt giere ich nun natürlich auch, mein System zu aktualisieren. Der neue Finder jedenfalls [...]]]></description>
			<content:encoded><![CDATA[<p>.. und der ist überwältigend.<br />
Mac OS 10.5 Leopard mit Becks und Fingerfood. Jedenfalls hat mein Applehändler vor der Tür, nachdem er heute um 18:00 Uhr das zweite Mal öffnete guten Umsatz mit dem neuen Betriebssystem von Apple gemacht. Und ganz verrückt giere ich nun natürlich auch, mein System zu aktualisieren.<br />
Der neue Finder jedenfalls ist sehr beeindruckend. Insbesondere, wenn man mit Windows-Rechnern in einem Netzwerk ist, ist das Symbol des Rechners ein angegilbter alter Bildschirm, auf dem ein Blue-Screen zu sehen ist. Sehr amüsant und mal wieder ein kleiner Seitenhieb von den immer selbstbewussteren Apple-Entwicklern.</p>
<p><img src="http://farm3.static.flickr.com/2164/1760817953_464bd9a564.jpg?v=0" alt="Mac OS 10.5" /><br />
<img src="http://farm3.static.flickr.com/2112/1760816623_ca9639cb15.jpg?v=0" alt="Mac OS 10.5 Fingerfood" /></p>
]]></content:encoded>
			<wfw:commentRss>http://wanderwort.de/2007/10/26/der-erste-eindruck-zahlt/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

