LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-24-2014, 01:12 PM   #1
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Rep: Reputation: 5
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.
 
Old 05-24-2014, 02:02 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 5,923

Rep: Reputation: 1407Reputation: 1407Reputation: 1407Reputation: 1407Reputation: 1407Reputation: 1407Reputation: 1407Reputation: 1407Reputation: 1407Reputation: 1407
methinks a simple shell script, put in $HOME/bin, would work better than an alias?
 
Old 05-24-2014, 03:53 PM   #3
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by ondoho View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script to display alias commands and un-alias any less than 12 characters bani Linux - Newbie 5 01-19-2014 12:34 PM
LXer: alias.sh puts your Linux shell alias on the clouds LXer Syndicated Linux News 0 01-21-2013 12:00 AM
Wildcard email alias in /etc/alias file custangro Linux - Enterprise 1 10-02-2009 12:17 PM
Alias Problem ahendo10 Linux - Newbie 12 03-13-2009 07:10 PM
alias problem petarsabev Slackware 1 10-12-2003 02:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration