From owner-freebsd-bugs Tue Jul 17 23:56:39 2001 Delivered-To: freebsd-bugs@freebsd.org Received: from bazooka.unixfreak.org (bazooka.unixfreak.org [63.198.170.138]) by hub.freebsd.org (Postfix) with ESMTP id 6B42037B408 for ; Tue, 17 Jul 2001 23:56:27 -0700 (PDT) (envelope-from dima@unixfreak.org) Received: from hornet.unixfreak.org (hornet [63.198.170.140]) by bazooka.unixfreak.org (Postfix) with ESMTP id 7F3393E34; Tue, 17 Jul 2001 23:56:25 -0700 (PDT) To: kesu Cc: bugs@freebsd.org Subject: Re: Shell variables don't expand always... In-Reply-To: <20010718012832.P48799-100000@kesuki.dyndns.org>; from kesu@kesuki.dyndns.org on "Wed, 18 Jul 2001 01:41:04 -0500 (CDT)" Date: Tue, 17 Jul 2001 23:56:25 -0700 From: Dima Dorfman Message-Id: <20010718065625.7F3393E34@bazooka.unixfreak.org> Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org kesu writes: > This bug seems to be a feature of someone who's never used a sh script to > write html. Apparently "" allows variables to expand while '' does not. > since `` is used to execute there are no other 'allowed' quote character > that I can see (not for a shell anyways) The problem, html uses ""'s so > unless I individually escape them i can't get variables to expand wfor > auto generated html. I hate escapes... I always mess up my scripts when I > use escapes and it takes me hours to figure out why, which is why I avoid > them at all costs. These are simply 5 minute scripts designed to just > automate a mundane and repetitive html writing task and I need the > variable to expand and I need ""'s inside the html, and escapes drive me > crazy. so when I upgraded last feb, and unknowningly broke a script I > never thought to check on, and just today discovered why and how it broke > I really have to nosider it a bug, enen though it was probably a feature > for someone to write a script to auto generate some java/javascript (which > might need the variables intact and probably hate escapes) If you know it's not a bug, why did you send this message? Yes, it is a feature, and I for one find it useful; sometimes you simply don't want variables to be expanded. Furthermore, this will not be changed; sh is governed by numerous standards, and changing it just for you simple isn't acceptable to anybody else. If you really don't want to use escapes, you can try something like this: oq='"'; cq='"'; echo "FreeBSD"; I.e., use a variable that will expand into a quote. (I used two that expand to the same thing for aesthetical reasons; you don't have to do that.) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message