Re: mailx error "Unknown tilde escape"

From: John Beck (jbeck+news_at_eng.sun.com)
Date: 09/22/04


Date: Wed, 22 Sep 2004 16:37:05 +0000 (UTC)

Todd> I am receiving this error from command line using mailx. example command
Todd> is mailx -s "something" email@xxx.com < file name. Yields results like
Todd> " Unknown tilde escape." repeated many times, followed by the ~ escape
Todd> command options.

Neil> Make sure that your message (i.e. the contents of the input file) does
Neil> not contain any lines beginning with "~".

Neil> IMO they should fix this, so that "mailx" only looks for tilde escapes
Neil> when stdin is a terminal device.

JBeck> I filed Sun bug

JBeck> 5105222 *mailx* should ignore tilde-escapes when stdin is not a tty

JBeck> We will try to get this fixed soon.

So it looks like mailx is behaving as intended. Look at /etc/mail/mailx.rc

if t
        # mailx-only defaults here
        ...
else
        # mailtool-only defaults here
        ...
        # have to allow ~ escapes even though not using tty
        set escapeok
endif

The "set escapeok" line is what is causing you grief. Get rid of that, and
your problem will probably go away, though others may be introduced. As a
result, we may not be able to "fix" this without introducing compatibility
issues. However, this work-around does the trick for me: add the following
to your $HOME/.mailrc file:

if t
        # input is a tty
        set escapeok
else
        unset escapeok
endif

-- John



Relevant Pages

  • Re: mailx error "Unknown tilde escape"
    ... Todd> I am receiving this error from command line using mailx. ... Neil> Make sure that your message does ...
    (comp.unix.solaris)
  • Re: mail command option for return address on linux
    ... I am migrating/porting Solaris scripts to Linux Platform. ... One of script uses mailx command on Solaris and we don't have mailx on ... At the time that was, amongst others, used in News control ...
    (comp.mail.misc)
  • mail command option for return address
    ... I am migrating/porting Solaris scripts to Linux Platform. ... One of script uses mailx command on Solaris and we don't have mailx on ... Instead we are using mail command. ...
    (linux.redhat)
  • mail command option for return address on linux
    ... I am migrating/porting Solaris scripts to Linux Platform. ... One of script uses mailx command on Solaris and we don't have mailx on ... Instead we are using mail command. ...
    (comp.mail.misc)
  • Re: mail command option for return address
    ... I am migrating/porting Solaris scripts to Linux Platform. ... One of script uses mailx command on Solaris and we don't have mailx on ... Instead we are using mail command. ...
    (linux.redhat)