Re: variable with "-" sign

From: Keith Thompson (kst-u_at_mib.org)
Date: 04/03/05


Date: Sun, 03 Apr 2005 21:43:07 GMT

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")

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center             <*>  <http://users.sdsc.edu/~kst>
We must do something.  This is something.  Therefore, we must do this.


Relevant Pages

  • Re: variable with "-" sign
    ... >> than starting to use ones with hyphens. ... >> Now on to the real problem. ... >> name and then create a patch and write the stupid author and send the ... >> because he wrote a non POSIX conforming script. ...
    (comp.unix.shell)
  • Re: if question
    ... I tried the suggestions outside of my script and they work fine, ... the real problem has to do with the command line application I'm calling. ... > In and of itself that's pretty useless since the returned value is ... > thrown away. ...
    (comp.lang.tcl)
  • Re: Bryan Singer Wants to Direct Star Trek XI
    ... The Nemesis script could have done with another polish - it was pretty much ... a first draft - but it was actually pretty decent. ... Mind you, I thought the finished movie was harmlessly entertaining fluff, ... The real problem seems to be its having been rushed through the production ...
    (uk.media.tv.sf.startrek)
  • Re: DNS lookup delays
    ... > urgent need (with a little script as a workaround to keep me going ... Don't forget to get around to resolving the real problem. ...
    (linux.redhat.install)
  • Re: Redirect to Screen & File
    ... On Thu, 12 May 2005 at 02:40 GMT, Kenny McCormack wrote: ... Thank you for playing our game. ... >> Script is not an appropriate answer to the question. ... > the OP's real problem is. ...
    (comp.unix.shell)