3

In bash: I input the command:</p>

getopt -l name,data -- --namd

and the output is

-- name,pp -- --namd

input :

getopt -l name,data -- --name

the output alse

-- name,pp -- --name

why it dosen't tell me the err when i input getopt -l name,data -- --namd?

4

1 回答 1

7

The problem is that on the mac, getopt is the BSD based getopt, rather than the gnu-based getopt.

It doesn't understand long options. It's not that it 'doesn't work well', it's that it's not designed to do what you asked.

于 2012-08-02T13:02:31.023 回答