Ubuntu :: Using Shell - Mailing Myself LS (or Any) Outputs

Oct 27, 2010

I have been having some fun with the shell but have become a little lost. I want to be able to email (myself and others) outputs from various commands etc. Sometimes people wish to know the contents of my music library etc and it's nice to be able to ssh in and email an ls (or similar) output.

Here is what I have been doing:
Code:
ls -R /home/simon/mount/sata0/audio > /tmp/musiclist
mail -s $(date +%Y%m%d) email@domain.com < /tmp/musiclist
The date part works perfectly and I receive an email with a subject suiting my preferential YYYYMMDD format.

But what I'd like to figure out is how to get this into a single line of code, my first attempt was:
Code:
mail -s $(date +%Y%m%d) email@domain.com < $(ls -R /home/simon/mount/sata0/audio)
This generates an error:
-bash: $(ls -R /home/simon/mount/sata0/audio): ambiguous redirect
But if I simply run the code "ls -R /home/simon/mount/sata0/audio" - the output is exactly what I want.

Is what I'm trying to do even possible? I do realise that I could use something like this
Code:
ls -R /directory > /tmp/file && mail -s $(date +%Y%m%d) email@domain.com < /tmp/file
But this is still running two commands and I'd like to figure out how to be 'cleverer'.

View 2 Replies


ADVERTISEMENT

Programming :: Shell Script - Which Should Diff Between PS Outputs

Feb 16, 2010

I would like to make a one-liner, which diff's "ps aux" output before and after killing a process. So basically it should be a combination of fallowing commands:
1) diff -u
2) ps aux | awk '{print $2}'
3) kill `ps aux | grep [c]ron | awk '{print $2}'`
4) ps aux | awk '{print $2}'

How to achieve this? Something like this:
Code:
diff $( kill `ps aux | grep [c]ron | awk '{print $2}'` && ps aux | awk '{print $2}' ) $( ps aux | awk '{print $2}' )
I don't have pgrep or pkill available.

View 3 Replies View Related

General :: Formatting - Shell Script That Outputs Few Variables

Jun 6, 2011

I hav a shell script that outputs few variables. i want to output them in a table format. any unix commands?

The output i need is:

View 4 Replies View Related

Programming :: Requesting Shell Script That Only Outputs Directories That Contain Subdirectories?

Jan 7, 2010

I have a directory that has about 5,000+ folders in it and I'd like to run a script that outputs any directory that contains a subdirectory.

View 4 Replies View Related

Ubuntu :: Good Mailing List Software Package?

Apr 20, 2010

Can anyone recommend a good mailing list software package?
I was using group mail under windows but before I set up a windows machine for this task, I thought I would try to find a linux solution.

View 1 Replies View Related

Server :: Implementing A Mailing List?

May 17, 2009

Myself and a friend have our own small IT business; we mainly design and build web sites for other small businesses. One of the things we would like to offer to clients is the ability to relay email addressed to their company's domain to their own personal email address (either web-based, or hosted by their ISP).

Now, clearly there is a risk of our mail relay being marked as "open", and therefore becoming black listed as a source of spam. Not something that we want to happen!setting up such a system? I understand how I would go about configuring an MTA like Postfix or Sendmail to perform such a task, but I'm unsure how I would ensure that relayed mail is delivered and we're not labeled as spammers.

I did wonder if perhaps the "mail forwarding" options in a mail server like Zimbra would get around the issue by forwarding on messages inline or as attachments within new emails (so the messages would appear to be from the account hosted on our server).

View 8 Replies View Related

Red Hat :: Command Fro Attaching File While Mailing?

Dec 21, 2010

How to send an ordinary file as well as an Excel file as an attachment while sending mail in redhat.

View 5 Replies View Related

Fedora :: Mailing List - Mailman Or Majordomo?

Oct 9, 2010

I've got a general question : I am using F13 for servers... I planned to use a mailing list now.

1) Which one would you recommend ? Mailman or Majordomo ?
2) I am looking for the possibility to get feedback of the mailing list.. ( Who opened, how many times..etc... )

Does Mailman provide this kind of info? (I didn't find anything on this during my first research). If not, which additional software can do it?

View 1 Replies View Related

General :: Mailing Newest File In A Directory?

Jan 16, 2010

writing a bash script that looks in a particular directory and emails the contents of the newest file.

View 1 Replies View Related

General :: Getting System Administrator Mailing Lists?

Mar 3, 2011

does any linux admins out there have any mailing lists that they subscribe to? I go to lots of sites for knowledge but i was trying to put together the double whammy and pull together a solid mailing list for linux admins as well.

View 6 Replies View Related

General :: E-Mailing Whole Output Of A File With Crontab

May 3, 2011

I have this code that is 'bashed' regularly with crontab and basically it will send me an E-Mail of most of the output but it misses out some of it!

Here is the crontab code to automatically run the script:

Code:

So that sends me an E-mail with most of the output of the following code:

Code:

It sends me everything up to echo "*******" "Begin compressing and transferring files" "*******" but it wont output the tar bit.. so it should give me a list of files that have been tarred.

View 1 Replies View Related

Software :: Evolution Mail Not Mailing / Get It To Work?

Jan 4, 2009

I have imported a csv address book into Evolution, which seemed to work, and I have composed a couple of emails to different people. Their email addresses seems to be entered, but when I send them, they are immediately kicked back telling me that the recipient is invalid. It provides their email and IP address, but tells me that they are invalid. I am receiving mail, so that is not a problem. I would reply to the mails I got to see what happens, but they are more or less spam. I'm pretty sure that I have the account configured correctly, but am at a loss.

View 4 Replies View Related

General :: Creating Mailman Mailing Lists On OpenSUSE?

Jan 30, 2011

how to create a mailing list using the 'newlist' command in /var/local/mailman/. I sucessfully create the list and i receive a confirmation message but after adding members to the list, none of them receives mail sent to list.

View 1 Replies View Related

General :: Mailing List - Broadcast Email To Every Member

May 26, 2010

I am new to Linux and we want to broadcast an email to every member of our institution. Currently we have more than 150 email addresses and 2 email lists. The mail server is running on Redhat version 5, x86_64/i386

View 2 Replies View Related

Software :: Securing Sendmail Aliases - Mailing Lists ?

Jul 28, 2010

I'm using sendmail on a small server and in addition to several users I have a few small email lists implemented in the aliases file. Is there any way to secure these aliases so that they can only be used by users with accounts on the machine already?

I'm getting a lot of external spam sent to the lists and I figure this is the easiest way to deal with it. 100% security isn't even necessary if I can stop most of the spam (i.e. causing sendmail to discard any mail sent to the lists that don't originate with the same domain name as the server would kill 99% of the spam since most of it doesn't have a spoofed email matching our server's domain name). I'm using Debian Lenny.

View 1 Replies View Related

Programming :: Sending Mail To Mailing-lists In Perl?

Jan 25, 2011

Im creating a perl script that will be sending out mail to mailing-lists, but im not getting it to work. Its no problem getting the script to send mail to regular mail addresses, but it doesnt seem to handle to send mail to mailing lists. Im using the Net::SMTP perl module.how to send mail from a perl script to a mailing list (and not just regular mail addresses) ?

View 2 Replies View Related

Server :: Remote Administer A Mailing List In Qmail-toaster?

Jan 3, 2010

I've a problem on--how to administer a mailing list on qmail by list owner himself?

View 1 Replies View Related

Ubuntu :: No Outputs Listed By Xrandr?

Mar 21, 2010

I'm trying to use this thread to set my laptop's resolution to 640x480. To do this, I need to use the addmode command which expects me to list an OUTPUT. What OUTPUT do I list? The "xrandr -q" command doesn't list any outputs.Here is the result of me typing "xrandr -q":

Code:
Screen 0: minimum 800 x 600, current 1024 x 768, maximum 1024 x 768
default connected 1024x768+0+0 0mm x 0mm

[code]...

View 5 Replies View Related

Ubuntu Multimedia :: Devede Only Outputs The .mpg

May 30, 2011

I've been having issues with Devede on my desktop although I used to use it on my laptop back in the day. I click videocd and under advanced options select ISO but can only get the output of a new .mpg. I've also tried to create disc structure but had the same result. I've uninstalled and reinstalled via the software center and still nothing has changed. Currently I'm having to use wine to run ConvertXtoDVD and then burn with K9Copy.

Running Ubuntu 11.04.

View 2 Replies View Related

Ubuntu Multimedia :: Multiple Audio Outputs Not Available

Oct 28, 2010

I've searched high and low, and can't seem to find a solution to this. I'm running a Dell Inspiron with an HDMI output with 10.10 through the tv. I want to get HDMI sound output for VLC, but I also want S/PDIF output (to the stereo) for Musicplayer. I can test and use the HDMI in the sound preferences sound/preferences/sound, but when I try to do the same for the internal card and click 'test speakers' the sound program closes itself. When the machine was a windows machine, it had PowerDVD outputting to the TV and Mediaplayer outputting to the stereo. I'm aiming for a similar set up in Ubuntu.

View 1 Replies View Related

Ubuntu Multimedia :: Pulse Audio Multiple Outputs?

Apr 3, 2010

I've searched and searched and can't find a straight answer about this. I want to sent the same signal out of the digital output and one of the analog outputs on the soundcard (Intel HDA) on my motherboard. I'm using ALSA and Pulse Audio.

View 5 Replies View Related

Fedora :: Compiz Is Detecting The Outputs?

Jan 27, 2011

Since i upgraded to F14 I have been having an annoying problem with compiz: I have twinview and an nvidia 8800GTS. Windows like transmission and pidgin that i put on my second monitor and then hide, have their position reset to the center left side of the screen on the absolute border of the first monitor. this is probably a problem with how compiz is detecting the outputs.

EDIT: Any windows that have their position saved to the second screen will be reset to hug the center left side of the screen.

SOLVED: I manually set the outputs in compiz and the selected use largest output first in Place Windows plugin.

View 2 Replies View Related

Programming :: Execute The String That Sed Actually Outputs?

Aug 2, 2010

I've been able to get the right output that I need from sed, but how can I execute the string that sed actually outputs?

View 3 Replies View Related

General :: Redirect All Outputs From /dev/console To /dev/pts/0?

Aug 9, 2010

The serial console is for debugging and will physically disappear when product is mature. However, there are many background processes that may print out statuses/results. These go to /dev/console or serial console. Telnet will be the only way to get a console. I tried netconsole (with netcat) and it works, but it is only for kernel printk messages. I tried "program > /dev/pts/0" and it works also. it would be better if I can just change/add the console /dev/pts/0 to the existing /dev/console.

View 3 Replies View Related

Ubuntu Multimedia :: Switch Pulseaudio Inputs And Outputs With One Click?

Sep 10, 2010

With pulseaudio handling sound on Lucid (10.04), when I plug in my USB headset it's recognized, but there was no easy way to have it be used without going to System > Preferences > Sound > Input & Output and checking the radio buttons. Then if it's unplugged, and plugged in again later, the setting has been lost, so it was back through the menus. Not good when the headset's not plugged in and I'm fumbling to answer a Skype call. What would be ideal is if pulseaudio could prioritize and always default to the headset when it's plugged in. But I'm told by one of the pulseaudio gods (Col) that it can't yet.Here's a way to at least get the switch down to one button on the panel bar.0. Get all your devices plugged in1. Find your outputs (speakers, headphones):Quote:pacmd list-sinks | grep alsa_output2. Find your inputs (such as a microphone):Quote:pacmd list-sources | grep alsa_input3. Write a bash file to choose one or both, like this but with device names appropriate to your system which you've discovered above for the alsa_output.* and alsa_input.* strings.Quote:

#! /bin/bash
pacmd set-default-sink alsa_output.usb-Generic_FREETALK_Everyman_0000000001-00-Everyman.analog-stereo
pacmd set-default-source alsa_input.usb-Generic_FREETALK_Everyman_0000000001-00-Everyman.analog-stereo

[code]....

View 7 Replies View Related

Ubuntu Multimedia :: Iec958 Digital Outputs To Analog Speakers

Oct 23, 2010

I'm trying to get my Audigy 2 Value to output digital but when I try to use the iec958 interface it outputs to the front speakers analog outputs, ie not the digital io socket.

I can get 5.1 surround by using the plug:surround51 device.

Have gone though other guides trying to fix the problem but no luck. how to get the digital stuff working. I have included some outputs.

Code:

Code:

View 3 Replies View Related

General :: Piping Data To Multiple Outputs?

Mar 29, 2011

I remember there was a command that would allow me to pipe data to an app and the use the | operator to pipe it into yet another app.

foo fooArg | Iforget app1 | app2

I forget what this command is but it pipes the data from foo into app1 and app2.

View 3 Replies View Related

Programming :: Catch Some Outputs In Two Different Log Files In Bash?

Jan 26, 2009

I want to catch some outputs in two different log files in bash, file simple.log and all.log So far, the script is started like this:

Code:

xterm -e "(./myscript.sh | tee -a simple.log) >& all.log"

What I want is:

- In simple.log, I want all the stdout but WITHOUT errors.

- In all.log I want BOTH stdout and stderr.

So all is ok, and the output becomes:

all.log

Code:

starting copying files
mv: cannot move ... : permission denied
copying completed
simple log

Code:

starting copying files
copying completed

But, in the new xterm, I'm loosing stdout. There is no output.How can I have the files logged as they are but also have the stdout in the xterm.

View 6 Replies View Related

Ubuntu :: Curl -K Command Outputs Weird Symbols Instead Of Downloading URL From File?

May 16, 2011

I'm on Ubuntu 11.04. I have read around about how to use curl to download a list of URLs from a text file, and everyone says to use

Code:
curl -K URLlist.txt This is what the curl man page says as well. However, for even a simple file with one URL, this command outputs a bunch of weird symbols for me instead of downloading the file. For example, I have a text file "test.txt" with one line in the following format:

Code:
url = "http://www.example.com/image.jpg" I use the curl command to download this file:

[Code]...

View 2 Replies View Related

Programming :: Compare Two Md5sum Outputs To See If The Files Match?

Nov 5, 2010

I would like to compare two md5sum outputs to see if the files match. in my script I have

Code:

ORG_FILE="/path/to/org/file.zip"
NEW_FILE="path/to/new/file.zip"
MD5_ORIG=$(md5sum -b "$ORG_FILE")

[code]....

How do I get just the MD5 hash and not the */.... stuff so I can compare them. i tried Code: JUST_HASH=${$MD5_ORIG:0:32} but All I get is

dir_mon_notify.sh: line 79: ${$MD5_ORIG:0:32}: bad substitution

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved