<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Tech-Recipes - Latest Comments in Hide password entry in Bourne/bash shell script | Bourne shell scripting | Tech-Recipes</title><link>http://tech-recipes.disqus.com/</link><description>Cookbook of Tech Tutorials</description><language>en</language><lastBuildDate>Wed, 14 Dec 2005 03:51:27 -0000</lastBuildDate><item><title>Re: Hide password entry in Bourne/bash shell script | Bourne shell scripting | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/278/hide-password-entry-in-bournebash-shell-script/#comment-2767255</link><description>One more thing (OS and shell-dependent):&lt;br&gt;use closing redirection in the stty command:&lt;br&gt; stty -echo &amp;gt;&amp;amp;- 2&amp;gt;&amp;amp;-&lt;br&gt;&lt;br&gt;This helps to avoid obsolete "No terminal" message in the scripts.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Wed, 14 Dec 2005 03:51:27 -0000</pubDate></item><item><title>Re: Hide password entry in Bourne/bash shell script | Bourne shell scripting | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/278/hide-password-entry-in-bournebash-shell-script/#comment-2767254</link><description>Awesome!  I've never used trap before, but I'll be using it from now on.  That's a great solution to a very annoying problem.  Thanks for sharing!  Use of the trap command would make a great recipe..&lt;br&gt;&lt;br&gt;Q</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">qmchenry</dc:creator><pubDate>Wed, 14 Dec 2005 03:48:52 -0000</pubDate></item><item><title>Re: Hide password entry in Bourne/bash shell script | Bourne shell scripting | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/278/hide-password-entry-in-bournebash-shell-script/#comment-2767253</link><description>I also add the protection for the interruptions:&lt;br&gt;&lt;br&gt;trap "stty echo ; exit" 1 2 15&lt;br&gt;stty -echo&lt;br&gt;read password&lt;br&gt;stty echo&lt;br&gt;trap "" 1 2 15&lt;br&gt;&lt;br&gt;If the user press Ctrl+C in the password prompt, the normal stty mode will be restored</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">sttyecho</dc:creator><pubDate>Wed, 14 Dec 2005 03:43:39 -0000</pubDate></item><item><title>Re: Hide password entry in Bourne/bash shell script | Bourne shell scripting | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/278/hide-password-entry-in-bournebash-shell-script/#comment-2767252</link><description>Neat trick!  Beware that this is OS dependent.  It works on all the Linux flavors I've tried but not a Solaris 8 system.  If you are writing a script to run on many platforms, the old school method above may be more generic.  But if writing a script for a specific system, this is a much slicker method.  Thanks for sharing!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">qmchenry</dc:creator><pubDate>Wed, 27 Oct 2004 06:44:49 -0000</pubDate></item><item><title>Re: Hide password entry in Bourne/bash shell script | Bourne shell scripting | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/278/hide-password-entry-in-bournebash-shell-script/#comment-2767251</link><description>instead you can use -s option with read to hide the value like password&lt;br&gt;&lt;br&gt;read -s secret</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Wed, 27 Oct 2004 02:30:43 -0000</pubDate></item></channel></rss>