mailx question - Unix

This is a discussion on mailx question - Unix ; How can I pass a variable to mailx command? lets assume abc=20 mailx -s 'hello $abc' 'cbdb@asds.com' I cannot get the $abc to display 20. Any help. thanks...

+ Reply to Thread
Results 1 to 3 of 3

Thread: mailx question

  1. mailx question


    How can I pass a variable to mailx command?

    lets assume abc=20

    mailx -s 'hello $abc' 'cbdb@asds.com' < myfile


    I cannot get the $abc to display 20. Any help. thanks


  2. Re: mailx question

    On Thu, 05 Jul 2007 11:27:34 -0700, rogv24@yahoo.com wrote:
    >
    > How can I pass a variable to mailx command?
    >
    > lets assume abc=20
    >
    > mailx -s 'hello $abc' 'cbdb@asds.com' < myfile
    >
    >
    > I cannot get the $abc to display 20. Any help. thanks


    Have you tried
    mailx -s "hello $abc" cbdb@asds.com < myfile

  3. Re: mailx question

    In <1183660054.206029.275810@w5g2000hsg.googlegroups.c om> rogv24@yahoo.com writes:

    > mailx -s 'hello $abc' 'cbdb@asds.com' < myfile
    > I cannot get the $abc to display 20. Any help. thanks


    Single quotes will not expand variables. Use double quotes instead.

    --
    John Gordon A is for Amy, who fell down the stairs
    gordon@panix.com B is for Basil, assaulted by bears
    -- Edward Gorey, "The Gashlycrumb Tinies"


+ Reply to Thread