How To Dynamically Send Status_format From Mutt To Xterm Title?

When I use X I most often run mutt in xterm and I thought it might be nice to send mutt's status_format to the xterm title.

It is set as
Code:
set status_format="Mailbox is %f with %M messages [%v]  You have %n new messages."

in my .muttrc.

Is this possible and if so how to do it? Any help would really be appreciated.

I use bash btw.


Similar Content



Recursive Xterms Via .bashrc

I made the mistake of adding an xterm invocation to my ".bashrc" file. My intent was to simply execute an xterm upon initial login to the KDE environment on Debian Wheezy (though the distro probably would have made no difference). What happened is that with each invocation of "xterm", the new xterm would again invoke an "xterm" via the ".bashrc" file. Duh, infinite recursion of xterms upon login. Is there a simple way to invoke an xterm at login that doesn't itself lookup the ".bashrc" file? By the time someone answers this, I will probably find and answer somewhere in the bash/xterm man pages, but thought I'd throw it out there. Really felt stupid after having realized my mistake. Had to login to recovery command line mode and replace the ".bashrc" file with "/etc/skel/.bashrc". Cheerio

Mutt Does Not Show Full Subject

I use following shell script to send email. But the subject of email always shows "This" instead of "This is L_1.R is finished". You may refer http://www.linuxquestions.org/questions/linux-newbie-8/how-to-define-variable-in-%60ssh%60-4175540566/
Code:
host_list=("c15-0330-01.ad.mtu.edu" "c15-0330-02.ad.mtu.edu" "c15-0330-03.ad.mtu.edu" "c15-0330-04.ad.mtu.edu")
program=("L_1" "L_2" "L_3" "L_4")
subject="The job is finished"
ssh -f c15-0330-01.ad.mtu.edu 'echo' "the job ${program[0]} is finished" '|' 'mutt "zwang10@mtu.edu" -s' "This is "${program[0]}".R is finished";

Xterm

When we open xterm, how does it know which shell to start..

How To Define Variable In `ssh`

I need to use `ssh` to send command to different computers to run programs. Can I define a variable of `Directory` and `program` in front of this shell script? Then, I do not need to write them every time? The following is my shell script.

`host_list=("c15-0330-10.ad.mtu.edu" "c15-0330-11.ad.mtu.edu" "c15-0330-12.ad.mtu.edu")`
`# I have multiple programs`
`# program=c("L_1","L_2","L_3")`
`ssh -f "${host_list[0]}" 'set Directory="/home/campus27/zwang10/Desktop/AWRR/program/power/vmodel_1/nprot/K_10"; cd $Directory && nohup Rscript L_1.R> L_1_sh.txt;echo "The job L_1 is finished" |mutt "zwang10@mtu.edu" -s "The job L_1 is finished"';
ssh -f "${host_list[1]}" 'set Directory="/home/campus27/zwang10/Desktop/AWRR/program/power/vmodel_1/nprot/K_10"; cd $Directory && nohup Rscript L_2.R> L_2_sh.txt;echo "The job L_2 is finished" |mutt "zwang10@mtu.edu" -s "The job L_2 is finished"';
ssh -f "${host_list[2]}" 'set Directory="/home/campus27/zwang10/Desktop/AWRR/program/power/vmodel_1/nprot/K_10"; cd $Directory && nohup Rscript L_3.R> L_3_sh.txt;echo "The job L_3 is finished" |mutt "zwang10@mtu.edu" -s "The job L_3 is finished"';`

How To Configure Sendmail In Centos?

I need to send mails from our centos server, what are tools required ?

server
CentOS release 6.5 (Final)

How to check if sendmail is installed and configured?

I even tried mutt, I could install but not able to send mails. Is there any configuration required ?

Get The Time When Nohup R Program Finishes

I want to get the time when program starts and finishes. But it always show the same time. Here is my shell script. But it always show that `START TIME` is same as `END TIME`.
Code:
host_list=("c15-0330-01.ad.mtu.edu" "c15-0330-02.ad.mtu.edu" "c15-0330-03.ad.mtu.edu" "c15-0330-04.ad.mtu.edu")
program=("L_1" "L_4" "L_3" "L_4")
subject="The job is finished"
START=$(date +"r")
address="/home/campus27/zwang10/Desktop/AWRR/program/power/vmodel_1/nprot/K_10"
ssh -f "${host_list[0]}" "cd '$address' && nohup Rscript '${program[0]}.R' > '${program[0]}_sh.txt';echo 'The job\n $address\n${program[0]} is finished\nSTART TIME = $START\n' END TIME =`date +"%r"` | mutt zwang10@mtu.edu -s '${host_list[0]} - Job ${program[0]}.R finished' -a '$address/${program[0]}_sh.txt';"

.Xdefaults Is Empty!

I'm running Arch with i3. I'm trying to config xterm and realized that I didn't have a .Xdefaults file in my home directory. I saw in a forum that someone did

Code:
$ cd ~
$ touch ~.Xdefaults

I did that and it made a .Xdefaults file in my home folder but it is empty and I don't know what to do.

Sending Mail From Command Line

I searched the forums for my title and I am not finding exactly what I am looking for. I am not using a program to send mail, such as Thunderbird or whatever. I simply want to be able to send mail from my Ubuntu 14.04 DESKTOP version for logging. I use a program called Logwatch (used alot in RHEL or CentOS) to monitor the server itself. The program sends mail to the root user account on the machine, which I can check and see, and within the program conf file, I can add an external email address, but it never sends.

I'm familiar with the SMTP concept of sending mail, outgoing mail server authentication, etc. I don't care to run this box as an SMTP server, but I understand that I need some sort of SMTP or MTA program to send mail into the real world. I tried Postfix but couldn't get that to work, and the Logwatch program wants to use sendmail, so I installed that but I am having the same issue. I am sure it is a step I am missing.

I also can't figure out how to get the 'mail' cmd from Terminal to work. I use this command:
Code:
mail -s "test" | /usr/sbin/mail myemail@domain.com

it follows through the subject, CC, body, but when I try to hit either . or CTRL-D, it never sends the email, in fact is does nothing.

I also tried sendmail with this command:
Code:
sendmail -v my@email.com < /dev/null

I was just trying to send a test email. It logs into my SMTP mail server, which I already configured, and it tells me to type out the mail, then end with a "." by itself on a single line. I try this and it just sits there.

I am missing SOMETHING when trying to actually send the mail. I can get it written with subject and body, connected, but it never sends and I am probably missing a / or something.

I did find and follow these instructions, but it still isn't working with sendmail. If I need to go back to Postfix, I can do that, I don't honestly care what I use, I just want some programs such as Logwatch to be able to email me.
http://stackoverflow.com/questions/1...mail-on-ubuntu

How To Copy File From Remote Host To Local Host Then Delete From Remote Host

I have an expect script to SSH to a remote host and obtain some user inputs and information about the server/network configuration. The responses are saved in a text file that I then need to copy to my local host so that I can read the lines into variables for use in the parent shell script.

Is there a way to do this without needing to enter the username and password for the local host to use function scp? I have tried the following in my expect script to no avail:
Code:
spawn scp $usr@$host:$flnm .
expect {
	-re "(.*)assword:" { 
		send -s "$pswd\r"
	}
}

I have also tried to directly scp the file and enter the username and password to try to debug the issue, and that doesn't work either:
Code:
spawn scp file.txt user@host:file.txt
expect {
	-re "(.*)assword:" {
		send -s "password\r"
	}
	"you sure you want to continue connecting" {
		send -s "yes\r"
		exp_continue
	}
}

In both scenarios I have used exp_internal 1, and there are no errors. But I do not end up with the file on my local host.

Following the copy, I would like to delete the file from the remote host. Any suggestions on how to accomplish this?

Wont Let Me Log In

Hello,

I installed Mint 17 xfce onto a friend's HP netbook a few months ago. Up until now all has been working pretty perfectly.

From this evening, she tells me that after she types in her password the following message appears:

no exec. line in this session file [her password appears here in plain text!] running the GNOME failsafe session instead

The only option at this point is seemingly to click ok. After that, this message appears:

Could not find the GNOME installation will try running the failsafe xterm session

Again the only option is to click ok, then this appears for a few seconds:

Cannot find xterm start a failsafe session

Then it goes to a black screen (though you can see the mouse cursor) on which it stays indefinitely.

She tells me that she wasn't trying to do anything other than web browsing and email checking before this started happening so there doesn't seem to be any logical reason behind it. Does anybody have any idea what is happening and how to fix it?