* Xargs for email
@ 2006-11-29 18:15 Ron Sharcott
0 siblings, 0 replies; 3+ messages in thread
From: Ron Sharcott @ 2006-11-29 18:15 UTC (permalink / raw)
Anyone know if its possible to do the following?
who | awk '{print $1}' | sort -u | xargs -i echo `mailx -s "Nightly logoff
computers" {} < /messages/nightly.logoff.computers.msg`
Xargs seems to try and read the incoming file as if each word is a parameter
so the verbiage ends up in the 'To' line. Is there a better way to approach
this?
Ron Sharcott (3635)
^ permalink raw reply [flat|nested] 3+ messages in thread* Xargs for email
@ 2006-11-30 16:25 Ron Sharcott
0 siblings, 0 replies; 3+ messages in thread
From: Ron Sharcott @ 2006-11-30 16:25 UTC (permalink / raw)
Thanks all. I believe I have a solution now.
Ron Sharcott (3635)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Xargs for email
@ 2006-11-30 16:44 Ron Sharcott
0 siblings, 0 replies; 3+ messages in thread
From: Ron Sharcott @ 2006-11-30 16:44 UTC (permalink / raw)
Solution provided.
# This is where we send a notice out to latenight users
#who | awk '{print $1}' | sort -u | while read user ; do
#mailx -s "Warning: logoff nightly" $user <
/messages/nightly.logoff.computers.msg
#done
Avoid xargs and redirects. Loop the task as in a multiline command or a
script. Of course some solutions offered included using xargs to call a
shell with the command but these came after I had something working.
And never start a subject line on this list with "Re:" if you want to let
others know what a solution is. A royal pain that.
Ron Sharcott (3635)
-----Original Message-----
From: Bluejay@fujigreenwood.com [mailto:Bluejay@fujigreenwood.com]
Sent: Thursday, November 30, 2006 8:32 AM
To: Ron Sharcott
Subject: Re: Xargs for email
What was the solution?
-
Bluejay Adametz
Make the most of what comes, and the least of what goes.
Ron Sharcott <Sharcott@camosun.bc.ca>
Sent by: tru64-unix-managers-owner@ornl.gov
11/30/2006 11:26
To
"'tru64-unix-managers@ornl.gov'" <tru64-unix-managers@ornl.gov> cc
Subject
Xargs for email
Thanks all. I believe I have a solution now.
Ron Sharcott (3635)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-11-30 16:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-29 18:15 Xargs for email Ron Sharcott
-- strict thread matches above, loose matches on Subject: below --
2006-11-30 16:25 Ron Sharcott
2006-11-30 16:44 Ron Sharcott
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox