質問

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

役に立ちましたか?

解決

-- 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" "myemail@gmail.com"

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

echo "haha" | mult -s "test" -- -foo@bar.com

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.

他のヒント

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top