<?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: Using &#8216;select&#8217; for multiple choices in shell scripts</title>
	<atom:link href="http://muffinresearch.co.uk/archives/2007/11/08/using-select-for-multiple-choices-in-shell-scripts/feed/" rel="self" type="application/rss+xml" />
	<link>http://muffinresearch.co.uk/archives/2007/11/08/using-select-for-multiple-choices-in-shell-scripts/</link>
	<description>the personal blog of Stuart Colville covering modern web development techniques and best practices</description>
	<lastBuildDate>Mon, 21 May 2012 05:48:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: zagam</title>
		<link>http://muffinresearch.co.uk/archives/2007/11/08/using-select-for-multiple-choices-in-shell-scripts/comment-page-1/#comment-66515</link>
		<dc:creator>zagam</dc:creator>
		<pubDate>Sun, 03 Apr 2011 03:55:35 +0000</pubDate>
		<guid isPermaLink="false">http://muffinresearch.co.uk/archives/2007/11/08/using-select-for-multiple-choices-in-shell-scripts/#comment-66515</guid>
		<description>Handy for selecting files, but not available in dash.
Make sure such scripts start with &quot;#!/bin/bash&quot; or they
will break when you update system shell to dash.
&lt;code&gt;
#!/bin/sh
# Not in ksh (available in both bash and dash)
while :; do
read -rp &#039;POSIX: Pick an option:--
1) A
2) B
3) C
#? &#039; REPLY
case &quot;$REPLY&quot; in
1) x=A ;;
2) x=B ;;
3) x=C ;;
*) continue ;;
esac
echo &quot;You picked $x (option $REPLY).&quot;
echo &quot;Do $x.&quot;
break
done
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Handy for selecting files, but not available in dash.<br />
Make sure such scripts start with &#8220;#!/bin/bash&#8221; or they<br />
will break when you update system shell to dash.<br />
<code><br />
#!/bin/sh<br />
# Not in ksh (available in both bash and dash)<br />
while :; do<br />
read -rp 'POSIX: Pick an option:--<br />
1) A<br />
2) B<br />
3) C<br />
#? ' REPLY<br />
case "$REPLY" in<br />
1) x=A ;;<br />
2) x=B ;;<br />
3) x=C ;;<br />
*) continue ;;<br />
esac<br />
echo "You picked $x (option $REPLY)."<br />
echo "Do $x."<br />
break<br />
done<br />
</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>

