From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19193 invoked by alias); 11 Aug 2006 15:14:35 -0000 Received: (qmail 19186 invoked by uid 22791); 11 Aug 2006 15:14:34 -0000 X-Spam-Check-By: sourceware.org Received: from ACCESS1.CIMS.NYU.EDU (HELO access1.cims.nyu.edu) (128.122.81.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 11 Aug 2006 15:14:27 +0000 Received: from localhost (localhost [127.0.0.1]) by access1.cims.nyu.edu (8.13.6+Sun/8.13.6) with ESMTP id k7BFEQOV023129 for ; Fri, 11 Aug 2006 11:14:26 -0400 (EDT) Date: Fri, 11 Aug 2006 15:14:00 -0000 From: Igor Peshansky Reply-To: The Cygwin-Talk Maiming List To: The Cygwin-Talk Maiming List Subject: RE: Scripting fun! :-) (was Re: bash scripting nightmare. ( ) In-Reply-To: <004c01c6bce4$3b479470$a501a8c0@CAM.ARTIMI.COM> Message-ID: References: <004c01c6bce4$3b479470$a501a8c0@CAM.ARTIMI.COM> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes Mailing-List: contact cygwin-talk-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: cygwin-talk-owner@cygwin.com Reply-To: The Cygwin-Talk Maiming List X-SW-Source: 2006-q3/txt/msg00150.txt.bz2 On Fri, 11 Aug 2006, Dave Korn wrote: > On 11 August 2006 00:12, Linda Walsh wrote: > > > Dave Korn wrote: > > > >> Hey all, who's any good at bash scripting? > >> > > --- > > You are doing correctly, mostly. The simplest way to get from > > where you are, to where you want to be, is, well think of this: > > You have created a "command line" all stuffed into 1 variable, right? > > Ala: VAR="cvs co -D \"2006-08-10 15:00:00\" -P pci wimedia" > > The value of VAR (putting everything between two vertical bars) is: > > |cvs co -D "2006-08-10 15:00:00" -P pci wimedia| > > You have a "literal" expression in "VAR", meaning the quotes are stored > > as literals and have no special meaning. If you just try to use "execute" > > the literal, the arguments are passed in literally. > > > > What you want is for the quotes to regain their special meaning, which > > you can do by telling the shell to run it's "eval"uator over the expression > > again before executing, as in "eval $VAR". In line 9 of your code below, > > just add an "eval" before the argument. > > Thankyou thankyou thank you THANK YOU! > > That made it all seem so clear. I could see that the quote mark was > getting attached to the first word and not keeping the two words as one > arg, but I didn't know what it means or what to do with it. Eval'ing it > worked perfectly, just like you said. Thanks for saving my sanity! Not to sound defensive, but did you happen to see from yesterday? Just curious... Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha@cs.nyu.edu | igor@watson.ibm.com ZZZzz /,`.-'`' -. ;-;;,_ Igor Peshansky, Ph.D. (name changed!) |,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte." "But no -- you are no fool; you call yourself a fool, there's proof enough in that!" -- Rostand, "Cyrano de Bergerac"