Yan Zhu
Yan Zhu

Reputation: 4346

what is the "--" for mutt command?

I saw following command

echo "haha" | mutt -s "test" -- $myemail

it will send an email with subject "test" and content "haha" to my email address. However, I can't figure what is -- for. I check both manpage and try a couple of experiments. But it's still puzzling for me.

Anyone has some clue?

Thanks

Upvotes: 2

Views: 346

Answers (2)

Jim
Jim

Reputation: 1066

It means that there are no other options listed on the command line.

Upvotes: 0

PaulProgrammer
PaulProgrammer

Reputation: 17670

-- in many applications says "there are no more command line options, treat everything past this point as raw text on the command line."

In your example, you can probably omit and wrap the email in quotes (which also may not be strictly necessary).

echo "haha" | mutt -s "test" "[email protected]"

The -- helps if there's something odd expected afterwards, for example:

echo "haha" | mult -s "test" -- [email protected]

without -- the parser library might consider -foo to be a command line option, but with it, it considers it just some word on the command line.

Upvotes: 3

Related Questions