<?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>Tipset &#187; zsh</title>
	<atom:link href="http://hasumi.info/~h2/tag/zsh/feed/" rel="self" type="application/rss+xml" />
	<link>http://hasumi.info/~h2</link>
	<description>MacやiPhone/iPod Touch関連のTipsを書くハズが発散してるページ</description>
	<lastBuildDate>Thu, 04 Mar 2010 16:52:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>zshをログインシェルっぽくする</title>
		<link>http://hasumi.info/~h2/2009/01/07/zsh%e3%82%92%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e3%82%b7%e3%82%a7%e3%83%ab%e3%81%a3%e3%81%bd%e3%81%8f%e3%81%99%e3%82%8b/</link>
		<comments>http://hasumi.info/~h2/2009/01/07/zsh%e3%82%92%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e3%82%b7%e3%82%a7%e3%83%ab%e3%81%a3%e3%81%bd%e3%81%8f%e3%81%99%e3%82%8b/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 21:59:44 +0000</pubDate>
		<dc:creator>h2</dc:creator>
				<category><![CDATA[PC]]></category>
		<category><![CDATA[zsh]]></category>

		<guid isPermaLink="false">http://hasumi.info/~h2/?p=629</guid>
		<description><![CDATA[大したネタじゃないけど「毎回zshって打つのがヤダ！！」っていってる人に教えてあげたら，なんかウケがよかったのでメモ
下記のような理由で，「メインで使うシェルはzshやけど，ログインシェルにはできないと」いう人は以外と多 [...]]]></description>
			<content:encoded><![CDATA[<p>大したネタじゃないけど「毎回zshって打つのがヤダ！！」っていってる人に教えてあげたら，なんかウケがよかったのでメモ</p>
<p>下記のような理由で，「メインで使うシェルはzshやけど，ログインシェルにはできないと」いう人は以外と多いのではないでしょうか？</p>
<ul>
<li>LDAPで複数のサーバのアカウントを管理していると，zshが入っていないサーバにログインできない</li>
<li>まだ枯れていないので更新頻度が高く，もし失敗するとログインできず悲惨</li>
<li>特にBSD系などで，ユーザランドにあるシェルをログインシェルにすることに抵抗がある</li>
</ul>
<p>自分もcshしか入っていないサーバを管理する必要があって，デフォルトはcshです</p>
<p>とはいえ毎回ログインするたびにzshと入力するのはあまりにも面倒なので，ログイン後zshがあればzshを起動するようにしましょう</p>
<p>~/.login を次のような感じにします<br />
下記はzshがあればzshを，zshがなければbashを，bashもなければcshで我慢という例です<br />
 (NetBSDで使っているものから拝借）</p>
<pre class="brush: text;">
if ( -x `which zsh` ) then
    exec zsh
else if ( -x `which bash` ) then
    exec bash
else
    if ( ! $?SHELL ) then
        setenv SHELL /bin/csh
    endif
    # cshの設定
    # ・・・
endif
</pre>
<p>忘れずに，~/.zshenv で環境変数SHELLを設定しておきましょう<br />
~/.zshenv に書いておけば，シェルスクリプトを引数に渡された時にも読み込まれます</p>
<pre class="brush: text;">
export SHELL=`which zsh`
</pre>
]]></content:encoded>
			<wfw:commentRss>http://hasumi.info/~h2/2009/01/07/zsh%e3%82%92%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e3%82%b7%e3%82%a7%e3%83%ab%e3%81%a3%e3%81%bd%e3%81%8f%e3%81%99%e3%82%8b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
