assignment syntax

assignment syntax

Post by Bob Nelso » Tue, 02 May 2000 04:00:00



1). Why were the Bourne(-like) shells designed so that spaces
    around the assignment operator were prohibited? Is this just
    another ``/* You are not supposed to understand this? */''
    from SB?

2). If a Bourne-like shell were written to allow an assignment
    such as...

        var = 42

    ...what are some of the potential parsing problems (sans
    backward compatibility) that would arise?

--
========================================================================

      http://www.oldradio.com/archives/nelson/open-computing.html
``Those who don't understand UNIX are condemned to reinvent it, poorly.''

 
 
 

assignment syntax

Post by Christoph Lang » Wed, 03 May 2000 04:00:00



> 1). Why were the Bourne(-like) shells designed so that spaces
>     around the assignment operator were prohibited? Is this just
>     another ``/* You are not supposed to understand this? */''
>     from SB?
> 2). If a Bourne-like shell were written to allow an assignment
>     such as...
>         var = 42
>     ...what are some of the potential parsing problems (sans
>     backward compatibility) that would arise?

It would be more difficult to distinguish between a variable
assignment and a command. `var = 42' might be a call of the command
var with the arguments = and 42 rather than an assignment. However, I
must admit that I've never seen = as an argument or file name.

Christoph

--
"NSA GCHQ KGB CIA nuclear conspiration war weapon spy agent... Hi Echelon!"
Christoph Lange


 
 
 

assignment syntax

Post by Barry Margoli » Wed, 03 May 2000 04:00:00





>> 1). Why were the Bourne(-like) shells designed so that spaces
>>     around the assignment operator were prohibited? Is this just
>>     another ``/* You are not supposed to understand this? */''
>>     from SB?

>> 2). If a Bourne-like shell were written to allow an assignment
>>     such as...

>>         var = 42

>>     ...what are some of the potential parsing problems (sans
>>     backward compatibility) that would arise?

>It would be more difficult to distinguish between a variable
>assignment and a command. `var = 42' might be a call of the command
>var with the arguments = and 42 rather than an assignment. However, I
>must admit that I've never seen = as an argument or file name.

Are you sure?  How about:

test $? = 0

--

Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

assignment syntax

Post by Tim Goodw » Thu, 04 May 2000 04:00:00




Quote:>2). If a Bourne-like shell were written to allow an assignment
>    such as...

>        var = 42

Like rc, for example.

Quote:>    ...what are some of the potential parsing problems (sans
>    backward compatibility) that would arise?

In Tom Duff's rc, and current versions of the Open Source rc, you have
to quote `=' whenever it doesn't mean shell assignment.

    ; sh configure --prefix=/opt/gnu
    syntax error

Versions that work are:

    ; sh configure '--prefix=/opt/gnu'

    ; sh configure --prefix^'='^/opt/gnu

and, thanks to free careting,

   ; sh configure --prefix'='/opt/gnu

The first (erroneous) form is not ambiguous, but it slightly complicates
the parser (and the manual page!) to accept it.  The Open Source rc may
do so in the near future.

Tim.
--
Tim Goodwin   | "If you don't know what closures are, you probably don't
Leicester, UK | want to know what closures are." -- Larry Wall

 
 
 

1. inline assembler error - porting Intel syntax to AT&T syntax

// Intel syntax
void x( int *p ) {
  int example;
  __asm {
    mov esi, p
    mov  [ esi ], ebx
    mov [example], eax
   }

I'm porting the code to GCC, but got error

I couldn't access the data which *p points to, and got error like this:
    - error, undefined reference to `p'
I couldn't access varible example, and got error like this:
    - error, undefined  reference to `example'

and no error if it is a global varible

Can someone help me?

2. minicom automatic start

3. intel Syntax -> AT&T Syntax

4. impish Gnome

5. AT&T asm syntax but not IBM asm syntax?

6. Anybody using Linux on DELL DIMENSION P90 and P75 PCs?

7. access.conf syntax error without a syntax error

8. libc-4.5.8: strace from cron not working

9. indexed array assignments

10. KDE3.0.1 "Windows" key assignment

11. FILE assignment

12. pnp pcmcia address and irq assignment ??

13. IRQ assignment