X-Spam-Check-By: sourceware.org Date: Tue, 29 May 2007 11:20:35 -0400 (EDT) From: Igor Peshansky Reply-To: cygwin AT cygwin DOT com To: John cc: cygwin AT cygwin DOT com Subject: Re: echo with no line feed In-Reply-To: <4658FCBB.8030909@earthlink.net> Message-ID: References: <4657D057 DOT 4090502 AT earthlink DOT net> <20070526145859 DOT GA3313 AT ednor DOT casa DOT cgf DOT cx> <46585D7D DOT 1070805 AT earthlink DOT net> <20070526170712 DOT GA18329 AT trixie DOT casa DOT cgf DOT cx> <4658FB50 DOT 8060101 AT earthlink DOT net> <4658FCBB DOT 8030909 AT earthlink DOT net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Sat, 26 May 2007, John wrote: > I can't get: > > #! /bin/sh > echo "Type file name: \c" > read FNAME > echo $FNAME > # > > to work without the line feed (using " or ' quotes > in the echo). Any tips? '\c' is an escape sequence that prompts 'echo' to disable the trailing newline. However, you have to tell 'echo' to look for escape sequences, i.e., echo -e "Type file name: \c" (quotes don't matter). Alternatively, as Isaac said, both '/bin/echo' and the bash 'echo' builtin support the '-n' option to avoid the trailing newline, i.e., echo -n "Type file name: " (in which case you won't need the '\c'). HTH, Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com ZZZzz /,`.-'`' -. ;-;;,_ Igor Peshansky, Ph.D. (name changed!) |,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! Freedom is just another word for "nothing left to lose"... -- Janis Joplin -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/