<?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>skettle.com &#187; bash</title>
	<atom:link href="http://skettle.com/category/development/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://skettle.com</link>
	<description>The Blog Is Not The Point</description>
	<lastBuildDate>Thu, 22 Mar 2012 14:37:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Run &#8216;screen&#8217; and reconnect to the same session without arguments</title>
		<link>http://skettle.com/2007/09/16/screen/</link>
		<comments>http://skettle.com/2007/09/16/screen/#comments</comments>
		<pubDate>Sun, 16 Sep 2007 08:56:27 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[bash]]></category>

		<guid isPermaLink="false">http://skettle.com/2007/09/16/screen/</guid>
		<description><![CDATA[This is just a little nugget I&#8217;ve had around for a while. I&#8217;m dusting it off and posting here more to test the WP-Syntax WordPress Plugin than any other reason. I use screen, but I don&#8217;t leave myself logged in when I&#8217;m not at my computer. I can usually type &#8216;screen -R&#8217; to reconnect to [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a little nugget I&#8217;ve had around for a while.  I&#8217;m dusting it off and posting here more to test the <a href="http://wordpress.org/extend/plugins/wp-syntax/" target="_blank">WP-Syntax WordPress Plugin</a> than any other reason.</p>
<p>I use screen, but I don&#8217;t leave myself logged in when I&#8217;m not at my computer. I can usually type &#8216;screen -R&#8217; to reconnect to the same session the next day, but if I have more than one screen session running at once, I need to &#8216;screen -ls&#8217;, then figure out which one to reattach to. At least I think I need to do that&#8230; in addition to being to lazy to do all that, I&#8217;m too lazy to scour the man pages looking for the way to make it create or reattach to the same session every time.</p>
<p>If you call &#8216;screen&#8217; with parameters, they will be used instead&#8230; This should allow you to use screen completely normally when necessary.</p>
<pre language="bash">
#!/bin/sh
# Rename your screen binary to something else to get it out of
# the way, and save this script as 'screen' into the same
# directory. Make a note of what you called the original here:
SCREEN="/usr/local/bin/screen1"

# Make $DEFAULT_NAME whatever you want; you'll never actually see it:
DEFAULT_NAME="default_session"

if [ "$#" -eq 0 ]; then
    SCREENLS=`$SCREEN -ls | grep "$DEFAULT_NAME"`
    if [ "$SCREENLS" = "" ]; then
        $SCREEN -S "$DEFAULT_NAME"
    else
        $SCREEN -r "$DEFAULT_NAME"
    fi
else
    $SCREEN $@
fi</pre>
]]></content:encoded>
			<wfw:commentRss>http://skettle.com/2007/09/16/screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

