wordexp(3) -- A[0]='a b' gives error

William Park opengeometry@yahoo.ca
Thu Oct 17 06:22:00 GMT 2013


Hi, I'm not sure if it's bug or just misunderstanding.  Given two
similar cases,

    wordexp ("one:  A[0]='a b'  end", &w, 0);   --> error=5 (WRDE_SYNTAX)
    wordexp ("one:  'A[0]=a b'  end", &w, 0);   --> ok

the result should be 3 strings,

    one:
    A[0]=a b
    end

just like shell.  Yet, I get error for the first case.  I think
wordexp() is getting confused about glob [0] which is followed by
<single-quote> and then <space>.
-- 
William



More information about the Libc-alpha mailing list