Re: variable with "-" sign
From: c0ldbyte (c0ldbyte_at_comp.unix.admin)
Date: 04/04/05
- Next message: John Savage: "Re: how to find the first occurence of an specific text starting from the end of a file"
- Previous message: Heiner Steven: "Top 10 subjects comp.unix.shell"
- In reply to: Keith Thompson: "Re: variable with "-" sign"
- Next in thread: Lemieux: "Re: variable with "-" sign"
- Reply: Lemieux: "Re: variable with "-" sign"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 03 Apr 2005 23:21:21 GMT
On 2005-04-03, Keith Thompson <kst-u@mib.org> wrote:
> c0ldbyte <c0ldbyte@comp.unix.shell> writes:
> [...]
>> Standardized scripting that is not something that would pass any kind of
>> quiz with a proffessor. I do believe we have enough numbers, leters, and
>> underscores to use and come up with some better descriptive variables
>> than starting to use ones with hyphens. For those who dont know what a
>> hyphen is its the little key on your keyboard that looks like "-" that.
>> Now on to the real problem. Are you sure that the variable in question
>> isnt really $UNIX-$VERS instead of $UNIX-VERS and that possibly its just
>> a mistype in the file or something. Even if you should rewrite it if
>> there is variables being used that contain a hyphen in the actual variable
>> name and then create a patch and write the stupid author and send the
>> patch to him to make it easy on his life to fix the problem as hand
>> because he wrote a non POSIX conforming script.
>
> There's no reason to assume that the offending application is a
> script. If it's a C program, for example, the way to read an
> environment variable is the same regardless of what characters the
> name contains: getenv("UNIX-VERS") vs. getenv("UNIX_VERS")
>
Good point, I wasnt thinking about that aspect of the situation
and just assumed it was a script because thats just where I most
commonly think of that term being used. Thanks.
-- ( When in doubt, use brute force. -- Ken Thompson 1998 )
- Next message: John Savage: "Re: how to find the first occurence of an specific text starting from the end of a file"
- Previous message: Heiner Steven: "Top 10 subjects comp.unix.shell"
- In reply to: Keith Thompson: "Re: variable with "-" sign"
- Next in thread: Lemieux: "Re: variable with "-" sign"
- Reply: Lemieux: "Re: variable with "-" sign"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|