<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Tech-Recipes - Latest Comments in Simple Menu for User Input | Bourne shell scripting | Tech-Recipes</title><link>http://tech-recipes.disqus.com/</link><description>Cookbook of Tech Tutorials</description><language>en</language><lastBuildDate>Mon, 25 May 2009 13:39:34 -0000</lastBuildDate><item><title>Re: Simple Menu for User Input | Bourne shell scripting | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/983/simple-menu-for-user-input/#comment-9932718</link><description>there are sever problems in his, try this, its still not perfect, but it works:&lt;br&gt;#!/bin/bash&lt;br&gt;&lt;br&gt;## Clears the screen and builds the user input screen&lt;br&gt;&lt;br&gt;function screen() {&lt;br&gt;clear&lt;br&gt;cat &amp;lt;&amp;lt;EOF&lt;br&gt;####################################################################&lt;br&gt;## Main Screen for Input                                          ##&lt;br&gt;####################################################################&lt;br&gt;##                                                                ##&lt;br&gt;## User Name: [________________________________________]          ##&lt;br&gt;## Directory: [________________________________________]          ##&lt;br&gt;## Group:     [________________________________________]          ##&lt;br&gt;##                                                                ##&lt;br&gt;####################################################################&lt;br&gt;##            [ Preferences ]        [ Other Info ]               ##&lt;br&gt;####################################################################&lt;br&gt;## [_] Show Email?     [_] Receive News?                          ##&lt;br&gt;## [_] Show Address?   [_] Receive RSS?                           ##&lt;br&gt;####################################################################&lt;br&gt;EOF&lt;br&gt;}&lt;br&gt;&lt;br&gt;## This will echo out the contents of the helpString variable&lt;br&gt;## below the screen&lt;br&gt;function showHelp() {&lt;br&gt;tput cup 14 0&lt;br&gt;## Clear out the last information&lt;br&gt;echo " "&lt;br&gt;tput cup 14 0&lt;br&gt;echo $helpString&lt;br&gt;}&lt;br&gt;## Display the screen&lt;br&gt;screen&lt;br&gt;&lt;br&gt;## Set up the help information, and call the showHelp function&lt;br&gt;## that displays it&lt;br&gt;helpString="Enter the user or press ENTER to quit"&lt;br&gt;showHelp&lt;br&gt;tput cup 4 15&lt;br&gt;read username&lt;br&gt;## If they don't enter a username, quit&lt;br&gt;if [ "$username" = "" ]&lt;br&gt;then&lt;br&gt;exit&lt;br&gt;fi&lt;br&gt;&lt;br&gt;## Now go through and get the other data&lt;br&gt;helpString="Enter Home Directory"&lt;br&gt;showHelp&lt;br&gt;tput cup 5 15&lt;br&gt;read directory&lt;br&gt;&lt;br&gt;helpString="What group does $username belong to?"&lt;br&gt;showHelp&lt;br&gt;tput cup 6 15&lt;br&gt;read group&lt;br&gt;&lt;br&gt;helpString="Do you want to show the Email Address to others? [y/n"&lt;br&gt;showHelp&lt;br&gt;tput cup 11 4&lt;br&gt;read showEmail&lt;br&gt;&lt;br&gt;helpString="Do you want to show your Home Address to others [y/n]"&lt;br&gt;showHelp&lt;br&gt;tput cup 12 4&lt;br&gt;read showAddress&lt;br&gt;&lt;br&gt;helpString="Would you like to receive the News Letter?"&lt;br&gt;showHelp&lt;br&gt;tput cup 11 24&lt;br&gt;read getNews&lt;br&gt;&lt;br&gt;helpString="Would you like to receive the RSS Feed?"&lt;br&gt;showHelp&lt;br&gt;tput cup 12 24&lt;br&gt;read getRSS&lt;br&gt;&lt;br&gt;helpString="Thank you for your input"&lt;br&gt;showHelp&lt;br&gt;echo ""</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">LukeS</dc:creator><pubDate>Mon, 25 May 2009 13:39:34 -0000</pubDate></item><item><title>Re: Simple Menu for User Input | Bourne shell scripting | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/983/simple-menu-for-user-input/#comment-8598027</link><description>when i just copy paste your script and try to run, i encountered with below error, please suggest what is wrong... and thx for your script...&lt;br&gt;===============&lt;br&gt;ERROR:&lt;br&gt;user-input.sh: line 7: syntax error near unexpected token `newline'&lt;br&gt;user-input.sh: line 7: `cat &amp;lt;'&lt;br&gt;=================</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sunny</dc:creator><pubDate>Thu, 23 Apr 2009 00:41:52 -0000</pubDate></item></channel></rss>