Mailx: extract username from a file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Mailx: extract username from a file
# 1  
Old 05-08-2013
Mailx: extract username from a file

Hey guys,

I am trying to send email to the usernames listed in a ascii file. I know about the .mailrc file. I want to know if I there is a way to extract the usernames from a file and email them. I tried something like this:

mailx -s "subject" '~cat filename' < attachment

also tried many different methods by looking at mailx man page, is there a better way to do this. Currently trying to create a shell script and execute it. I am using /bin/csh.

thanks.
# 2  
Old 05-08-2013
This User Gave Thanks to joeyg For This Post:
# 3  
Old 05-08-2013
Thank you for help!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Why does "ps -[u|U] username" not list processes when username is numeric?

Greetings, The title pretty much says it all. I've snooped everywhere and can't find anything on this. Since our organization went to numeric usernames, using the u|U option for ps returns no processes. Example passwd entry: 320074:DjZAJKXun8HBs:10129:6006:Joe Y:/cadhome/analysis/jy:/bin/bash... (4 Replies)
Discussion started by: crimso
4 Replies

2. Shell Programming and Scripting

[Solved] Get username, etc. from config file

how can i get the database name from a config file its like this: // ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', 'userabc_wrdp1'); (there might be spaces in the front of "define") i want to store... (0 Replies)
Discussion started by: vanessafan99
0 Replies

3. Shell Programming and Scripting

help, extract username from file

there is a text file like this text here text here text here text here USER=someusername here text here text here text here how can i extract the someusername from this file which has a path like /home/myfile.txt? i want to store it in a variable $u (3 Replies)
Discussion started by: vanessafan99
3 Replies

4. Shell Programming and Scripting

Get username of last user to modify a file

Possible to get this? Thanks (2 Replies)
Discussion started by: stevensw
2 Replies

5. Shell Programming and Scripting

How to extract the subject from a script which uses mailx

Hi, I need to extract the subject of an e-mail sent using mailx. mailx is in a a file and the command reads like the following Ex: sendMail.sh mailx -s ' This is the subject' $recepiant note that anything can come within ' ' which goes to the subject. Please help (5 Replies)
Discussion started by: mwrg
5 Replies

6. Shell Programming and Scripting

How to Determine the file owner's username

I've read the following post here and I get no output from the command. I've tried changing the '$3' to $5, 7, 10...and still nothing. Ultimately what I'd like to is determine who owns the file and rename it to file_name_$USERNAME. $ uname -a SunOS sun001 5.10 Generic_118833-33 sun4u sparc... (3 Replies)
Discussion started by: nadeemsm
3 Replies

7. Shell Programming and Scripting

To find the username in /etc/passwd file

Hi, I need to a shell script to list out only the username in the /etc/passwd file. Regards Siva (7 Replies)
Discussion started by: gsiva
7 Replies

8. Shell Programming and Scripting

Need to modify a file of different username through script.

Hi ! All I want to write a script where, it will open a new shell with a username / pwd and modify a file of same username and exit. example: 1. UserA 2. UserB- FileB ScriptA -> su UserB -> Modify FileB -> Exit ScriptA Can somebody give me a direction , on how to... (2 Replies)
Discussion started by: dashok.83
2 Replies

9. UNIX for Dummies Questions & Answers

How to get the Username stored in another file

Hello, I have a file FSGReport.info which reads as export username=abc export password= 1333 Now I have another FTP script file FTP.sh in which I need to access the username and password stored in the file FSGReport.info . How can I access this file and get the username and password. Please... (1 Reply)
Discussion started by: vnatarajan
1 Replies

10. UNIX for Dummies Questions & Answers

Extract or save attachment of email using mailx

Hi, Could someone help me with 'Extract or save attachment of email using mailx' Thanks, Vijay ;) (1 Reply)
Discussion started by: kandati
1 Replies
Login or Register to Ask a Question