view dotfiles/.bash_profile.html @ 21:e07e18887175

Example html files and directory setup
author huston@80426f53-59d1-405d-934b-f07cd76f4a1a
date Tue, 22 Dec 2009 01:33:28 +0000
parents
children
line wrap: on
line source

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>~/.bash_profile.html</title>
<meta name="Generator" content="Vim/7.2">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#000000" text="#ffffff"><font face="monospace">
<font color="#00ffff"><b># $Id: .bash_profile 20 2009-11-25 18:43:02Z huston $</b></font><br>
<font color="#00ffff"><b>#</b></font><br>
<font color="#00ffff"><b># This file is sourced for interactive login shells, or</b></font><br>
<font color="#00ffff"><b># non-interactive shells with the --login option.&nbsp;&nbsp;So things which you</b></font><br>
<font color="#00ffff"><b># want to happen only on login shells should go here.</b></font><br>
<br>
<font color="#00ffff"><b># Get the aliases and functions</b></font><br>
<font color="#ffff00"><b>if </b></font><font color="#ffff00"><b>[</b></font>&nbsp;<font color="#ffff00"><b>-f</b></font>&nbsp;~/.bashrc <font color="#ffff00"><b>]</b></font><font color="#ffff00"><b>;</b></font>&nbsp;<font color="#ffff00"><b>then</b></font><br>
<font color="#ffff00"><b>&nbsp;&nbsp; . </b></font>~/.bashrc<br>
<font color="#ffff00"><b>fi</b></font><br>
<br>
<font color="#00ffff"><b># User specific environment and startup programs</b></font><br>
<br>
<font color="#00ffff"><b># BASH_ENV is sourced for non-interactive shells; however, since we</b></font><br>
<font color="#00ffff"><b># source ~/.bashrc above I don't think we have to here also.</b></font><br>
<font color="#00ffff"><b># export BASH_ENV=$HOME/.bashrc</b></font><br>
<br>
<font color="#00ffff"><b># These lines are helpful if you routinely might login without passing an</b></font><br>
<font color="#00ffff"><b># ssh-agent's authentication through.&nbsp;&nbsp;This way when you login, an agent is</b></font><br>
<font color="#00ffff"><b># exec'd for you (the corresponding lines in .bash_logout should kill the</b></font><br>
<font color="#00ffff"><b># agent when you logout, however they sometimes fail such as when killing your</b></font><br>
<font color="#00ffff"><b># shell without a proper logout or closing the connection).&nbsp;&nbsp;I left it here,</b></font><br>
<font color="#00ffff"><b># though I personally don't use/need it anymore.</b></font><br>
<br>
<font color="#00ffff"><b>#if [ &quot;X$SSH_AUTH_SOCK&quot; = &quot;X&quot; ] ; then</b></font><br>
<font color="#00ffff"><b>#&nbsp;&nbsp; eval `/usr/bin/ssh-agent`</b></font><br>
<font color="#00ffff"><b>#fi</b></font><br>
<br>
<font color="#00ffff"><b># This part is quite useful if you have your dotfiles stored in subversion</b></font><br>
<font color="#00ffff"><b># (though it could be edited fairly easily for any other version control</b></font><br>
<font color="#00ffff"><b># system I'm sure).&nbsp;&nbsp;We check the timestamp of the file '$HOME/.dotfilets'.</b></font><br>
<font color="#00ffff"><b># If it's older than a month, run a 'svn st -u' and touch it; this way we</b></font><br>
<font color="#00ffff"><b># check once per month to see if we forgot to pull down an updated version.</b></font><br>
<br>
<font color="#00ffff"><b># First set $STAT and $DATE since the syntax of the commands is different</b></font><br>
<font color="#00ffff"><b># between Linux and Mac OS X.&nbsp;&nbsp;If this is run elsewhere, the eval will be</b></font><br>
<font color="#00ffff"><b># false and the test not done below, so it's safe to not bother checking for</b></font><br>
<font color="#00ffff"><b># zero-length variables on the test - it just won't run the svn status, so you</b></font><br>
<font color="#00ffff"><b># won't be prompted if there's newer files available in your repository.</b></font><br>
<br>
<font color="#ffff00"><b>case</b></font>&nbsp;<font color="#ff6060"><b>`uname`</b></font>&nbsp;<font color="#ffff00"><b>in</b></font><br>
&nbsp;&nbsp; Darwin<font color="#ffff00"><b>)</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b>DFSTAT</b></font>=<font color="#ffff00"><b>&quot;</b></font><font color="#ff40ff"><b>stat -f %m -t %s </b></font><font color="#8080ff"><b>$HOME</b></font><font color="#ff40ff"><b>/.dotfilets</b></font><font color="#ffff00"><b>&quot;</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b>MDATE</b></font>=<font color="#ffff00"><b>&quot;</b></font><font color="#ff40ff"><b>date -v -1m +%s</b></font><font color="#ffff00"><b>&quot;</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b>TDSTAT</b></font>=<font color="#ffff00"><b>&quot;</b></font><font color="#ff40ff"><b>stat -f %m -t %s </b></font><font color="#8080ff"><b>$HOME</b></font><font color="#ff40ff"><b>/.todo</b></font><font color="#ffff00"><b>&quot;</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b>HDATE</b></font>=<font color="#ffff00"><b>&quot;</b></font><font color="#ff40ff"><b>date -v -1h +%s</b></font><font color="#ffff00"><b>&quot;</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>;;</b></font><br>
<br>
&nbsp;&nbsp; Linux<font color="#ffff00"><b>)</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b>DFSTAT</b></font>=<font color="#ffff00"><b>&quot;</b></font><font color="#ff40ff"><b>stat -c %Y </b></font><font color="#8080ff"><b>$HOME</b></font><font color="#ff40ff"><b>/.dotfilets</b></font><font color="#ffff00"><b>&quot;</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b>MDATE</b></font>=<font color="#ffff00"><b>&quot;</b></font><font color="#ff40ff"><b>date -d </b></font><font color="#ff6060"><b>\&quot;</b></font><font color="#ff40ff"><b>1 month ago</b></font><font color="#ff6060"><b>\&quot;</b></font><font color="#ff40ff"><b>&nbsp;+%s</b></font><font color="#ffff00"><b>&quot;</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b>TDSTAT</b></font>=<font color="#ffff00"><b>&quot;</b></font><font color="#ff40ff"><b>stat -c %Y </b></font><font color="#8080ff"><b>$HOME</b></font><font color="#ff40ff"><b>/.todo</b></font><font color="#ffff00"><b>&quot;</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b>HDATE</b></font>=<font color="#ffff00"><b>&quot;</b></font><font color="#ff40ff"><b>date -d </b></font><font color="#ff6060"><b>\&quot;</b></font><font color="#ff40ff"><b>1 hour ago</b></font><font color="#ff6060"><b>\&quot;</b></font><font color="#ff40ff"><b>&nbsp;+%s</b></font><font color="#ffff00"><b>&quot;</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>;;</b></font><br>
<font color="#ffff00"><b>esac</b></font><br>
<br>
<font color="#ff6060"><b>[[</b></font>&nbsp;<font color="#ffff00"><b>!</b></font>&nbsp;<font color="#ffff00"><b>-f</b></font>&nbsp;<font color="#8080ff"><b>$HOME</b></font>/.dotfilets <font color="#ffff00"><b>||</b></font>&nbsp;\<br>
&nbsp;&nbsp; <font color="#ff6060"><b>`</b></font><font color="#ffff00"><b>eval</b></font><font color="#ff6060"><b>&nbsp;</b></font><font color="#8080ff"><b>$DFSTAT</b></font><font color="#ff6060"><b>`</b></font>&nbsp;<font color="#ffff00"><b>-lt</b></font>&nbsp;<font color="#ff6060"><b>`</b></font><font color="#ffff00"><b>eval</b></font><font color="#ff6060"><b>&nbsp;</b></font><font color="#8080ff"><b>$MDATE</b></font><font color="#ff6060"><b>`</b></font>&nbsp;<font color="#ff6060"><b>]]</b></font>&nbsp;&amp;&amp; <font color="#ff6060"><b>{</b></font><br>
&nbsp;&nbsp; <font color="#ffff00"><b>echo</b></font><font color="#ff40ff"><b>&nbsp;-n Dotfiles last checked over a month ago</b></font><br>
<br>
&nbsp;&nbsp; <font color="#00ffff"><b># Here we switch for hosts we don't want to check, just warn</b></font><br>
&nbsp;&nbsp; <font color="#ffff00"><b>case</b></font>&nbsp;<font color="#ff6060"><b>`hostname -s`</b></font>&nbsp;<font color="#ffff00"><b>in</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bt<font color="#ffff00"><b>)</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#ffff00"><b>echo</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#ffff00"><b>touch</b></font>&nbsp;<font color="#8080ff"><b>$HOME</b></font>/.dotfilets<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#ffff00"><b>;;</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*<font color="#ffff00"><b>)</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#ffff00"><b>echo</b></font><font color="#ff40ff"><b>&nbsp;, running a status test.</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; svn st -u <font color="#ffff00"><b>&amp;&amp;</b></font>&nbsp;<font color="#ffff00"><b>touch</b></font>&nbsp;<font color="#8080ff"><b>$HOME</b></font>/.dotfilets <font color="#ffff00"><b>&amp;</b></font><br>
&nbsp;&nbsp; <font color="#ffff00"><b>esac</b></font><br>
<font color="#ff6060"><b>}</b></font><br>
<br>
<font color="#00ffff"><b># Work in progress - toodledo to ~/.todo</b></font><br>
<font color="#00ffff"><b>#[[ -f $HOME/.todo ]] &amp;&amp; cat $HOME/.todo</b></font><br>
<font color="#00ffff"><b>#</b></font><br>
<font color="#00ffff"><b>#case `hostname -s` in</b></font><br>
<font color="#00ffff"><b>#&nbsp;&nbsp; xanadu|rapture)</b></font><br>
<font color="#00ffff"><b>#&nbsp;&nbsp;&nbsp;&nbsp; TOODLEDO_CMD=&quot;hotlist&quot;</b></font><br>
<font color="#00ffff"><b>#&nbsp;&nbsp;&nbsp;&nbsp; ;;</b></font><br>
<font color="#00ffff"><b>#</b></font><br>
<font color="#00ffff"><b>#&nbsp;&nbsp; milton)</b></font><br>
<font color="#00ffff"><b>#&nbsp;&nbsp;&nbsp;&nbsp; TOODLEDO_CMD=&quot;tasks *Personal&quot;</b></font><br>
<font color="#00ffff"><b>#&nbsp;&nbsp;&nbsp;&nbsp; ;;</b></font><br>
<font color="#00ffff"><b>#esac</b></font><br>
<font color="#00ffff"><b>#</b></font><br>
<font color="#00ffff"><b>#[[ ! -f $HOME/.todo || \</b></font><br>
<font color="#00ffff"><b>#&nbsp;&nbsp; `eval $TDSTAT` -lt `eval $HDATE` ]] &amp;&amp; {</b></font><br>
<font color="#00ffff"><b>#&nbsp;&nbsp; echo &quot;To-do list as of `date`&quot; &gt; $HOME/.todo</b></font><br>
<font color="#00ffff"><b>#&nbsp;&nbsp; echo &quot;---------------------------------------------&quot; &gt;&gt; $HOME/.todo</b></font><br>
<font color="#00ffff"><b>#&nbsp;&nbsp; toodledo tasks &gt;&gt; $HOME/.todo &amp;</b></font><br>
<font color="#00ffff"><b>#}</b></font><br>
<br>
</font></body>
</html>