<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: $PWD  в приглашении Bash</title>
	<atom:link href="http://boombick.org/blog/posts/29/feed" rel="self" type="application/rss+xml" />
	<link>http://boombick.org/blog/posts/29</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 15 Aug 2010 21:13:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: anon</title>
		<link>http://boombick.org/blog/posts/29#comment-771</link>
		<dc:creator>anon</dc:creator>
		<pubDate>Sat, 13 Sep 2008 17:37:29 +0000</pubDate>
		<guid isPermaLink="false">http://boombick.org/blog/posts/29#comment-771</guid>
		<description>работающая в rhel5  и centos5 версия:

function truncate_pwd
{
    if [ $HOME == $PWD ]
    then
    newPWD=”~”
    elif [ $HOME == ${PWD:0:${#HOME}} ]
    then
    newPWD=”~${PWD:${#HOME}}”
    else
    newPWD=$PWD
    fi

    local pwdmaxlen=15
    if [ ${#newPWD} -gt $pwdmaxlen ]
    then
    local pwdoffset=$(( ${#newPWD} - $pwdmaxlen ))
   
    newPWD=..${newPWD:$pwdoffset:$pwdmaxlen}
    fi
}

PROMPT_COMMAND=truncate_pwd
PS1=\[\${newPWD}\]\\$\</description>
		<content:encoded><![CDATA[<p>работающая в rhel5  и centos5 версия:</p>
<p>function truncate_pwd<br />
{<br />
    if [ $HOME == $PWD ]<br />
    then<br />
    newPWD=”~”<br />
    elif [ $HOME == ${PWD:0:${#HOME}} ]<br />
    then<br />
    newPWD=”~${PWD:${#HOME}}”<br />
    else<br />
    newPWD=$PWD<br />
    fi</p>
<p>    local pwdmaxlen=15<br />
    if [ ${#newPWD} -gt $pwdmaxlen ]<br />
    then<br />
    local pwdoffset=$(( ${#newPWD} &#8211; $pwdmaxlen ))</p>
<p>    newPWD=..${newPWD:$pwdoffset:$pwdmaxlen}<br />
    fi<br />
}</p>
<p>PROMPT_COMMAND=truncate_pwd<br />
PS1=\[\${newPWD}\]\\$\</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: go</title>
		<link>http://boombick.org/blog/posts/29#comment-257</link>
		<dc:creator>go</dc:creator>
		<pubDate>Thu, 07 Feb 2008 21:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://boombick.org/blog/posts/29#comment-257</guid>
		<description>Очепятка:
не newPWD=”.+${newPWD:$pwdoffset:$pwdmaxlen}”, а
newPWD=”.”+”${newPWD:$pwdoffset:$pwdmaxlen}”
Вотъ.</description>
		<content:encoded><![CDATA[<p>Очепятка:<br />
не newPWD=”.+${newPWD:$pwdoffset:$pwdmaxlen}”, а<br />
newPWD=”.”+”${newPWD:$pwdoffset:$pwdmaxlen}”<br />
Вотъ.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Portnov</title>
		<link>http://boombick.org/blog/posts/29#comment-219</link>
		<dc:creator>Portnov</dc:creator>
		<pubDate>Tue, 05 Feb 2008 06:11:31 +0000</pubDate>
		<guid isPermaLink="false">http://boombick.org/blog/posts/29#comment-219</guid>
		<description>Можно еще так, скажем
export PS1=&quot;\W\$ &quot;
Будет показывать только имя текущей директории, без пути.</description>
		<content:encoded><![CDATA[<p>Можно еще так, скажем<br />
export PS1=&#8221;\W\$ &#8221;<br />
Будет показывать только имя текущей директории, без пути.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
