Why does $_ in $MAILPATH work weirdly?
张森
sen.zhang at gmail.com
Sun Jun 25 01:17:22 UTC 2006
On Sat, Jun 24, 2006 at 11:41:17AM -0700, Gary W. Swearingen wrote:
> 张森 <sen.zhang at 126.com> writes:
> ...
> > export MAILPATH=’/var/mail/madsen?"You have spool mails!":~/Mail/Inboxes/net9?"madsen at net9 has mails!$_":~/Mail/Inboxes/ce-lab?"zhangsen at ce-lab has mails!"’
> ...
> >
> > What drives me crazy is that the $_ in the $MAILPATH's messages just expands to the last argument of the last bash
> > command. But according to the bash's manual, $_ should expand to the mailfile name.
>
> Maybe bash gets confused by the weird quote character just following
> "MAILPATH=" (and at the end). "hd" shows it's 8 bytes long! It
> probably must be a normal single-byte single quote (AKA apostrophe).
>
> You probably copied some example code out of the manpage and got some
> funky Unicode character. A bug in bash manpage, IMO.
Thank you very much!!! :-) It's just the funky and weird quote character which causes the problem.
Thank you very much again:)!!!
// btw, why would some manuals would prefer to use the Unicode quote character? It really sucks.
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
--
************************************
* Best Regards! *
* Sen Zhang *
* ICT, CAS, China(PRC) *
* Homepage: http://madsen.net9.org *
************************************
More information about the ubuntu-users
mailing list