LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem getting alias right (https://www.linuxquestions.org/questions/linux-newbie-8/problem-getting-alias-right-4175505987/)

battles 05-24-2014 01:12 PM

Problem getting alias right
 
I am trying to implement an alias (or script would do) to make it easier to send an email with mailx.

alias sma='read -p "mail <addr> -r admin@host.net"; mail <addr> -r admin@host.net"$REPLY"'

The above is useless because I cannot use the left key to get back to the <addr> to put in the email address. The reason I need to do this is because I answer mail from within a particular user, but mail coming into that user account has to be bounced elsewhere.

Thanks.

ondoho 05-24-2014 02:02 PM

methinks a simple shell script, put in $HOME/bin, would work better than an alias?

battles 05-24-2014 03:53 PM

Quote:

Originally Posted by ondoho (Post 5176445)
methinks a simple shell script, put in $HOME/bin, would work better than an alias?

Probably so. I did get it to work to my satisfaction like this:

alias sma='read -p "[mail addr -r admin@inwtx.net] To: "; mail "$REPLY" -r admin@inwtx.net' #send a mail


All times are GMT -5. The time now is 06:16 PM.