Sponsored Content
Full Discussion: Shift reminder system
Top Forums Shell Programming and Scripting Shift reminder system Post 302537160 by cratercrabs on Friday 8th of July 2011 01:31:17 AM
Old 07-08-2011
Hi .,
I m struck here., cud u plz help...
I have changed some logic in this system., I have loaded my .csv file in another table and now comparing the two tables and fetching the mail id in the variable "e"
The code i used to send mail is
Code:
e=`sqlplus -s "username/pwd@DB" << EOF
select user_table.MAILID from user_table inner join onshore on user_table.RESOURCE_NAME = onshore.MHC;
EOF`
mailx -s "You are in shift today" $e

where onshore is the table made from .csv file.,

i m unable to send the mail., when i execute the script it stands till timeout and gets closed without sending mail...
Thanks in advance...

---------- Post updated 07-08-11 at 11:01 AM ---------- Previous update was 07-07-11 at 06:10 PM ----------

Hi .,
When i execute
Code:
e=`sqlplus -s "username/pwd@DB" << EOF
select user_table.MAILID from user_table inner join onshore on user_table.RESOURCE_NAME = onshore.MHC;
EOF`

alone., i could view the result wen i give echo $e.,
MAILID -------------------------------------------------- ram@abc.com hari@abc.com raj@abc.com MAILID -------------------------------------------------- ram@abc.com hari@abc.com raj@abc.com., but there are only 3 rows in the database.. why i am getting duplicate here???

And also i couldnt send mail using this
mailx -s "You are in shift today" $e., wen i execute i get "mail: illegal option -- ----" error ., Where i went wrong...!!????

Last edited by Franklin52; 07-08-2011 at 03:43 AM.. Reason: Please use code tags for code and data samples, thank you
 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

shift command

There is an error when i am trying to use the shift command in this way: ($1 = -d, $2 = 123, $3 = -c etc etc) for $arg in $@ do case $arg in "-d") shift; (so that the $2 will become the $arg now) (and while it loop the 2nd time,) ... (1 Reply)
Discussion started by: AkumaTay
1 Replies

2. Shell Programming and Scripting

shift command

Hi Folks, In shell scripting the maximum no. of command line parameters becomes 9(Am i right). If we want to get more than 9 parameters we use the shift command. Even here there are two possibilities. 1. Without the use of variables - The arguments are lost and the lost no. is equal to the... (6 Replies)
Discussion started by: Nisha
6 Replies

3. UNIX for Dummies Questions & Answers

shift not working

Hi, I wrote one script, in between script needs to use 10th and 11th positional parameters, that time i used "shift". Here i am facing the below find problem, ./DataCount.sh: cannot shift I tried 1) I have read man pages for shift 2) Before but * and ** 3) Simple shift with out giving... (4 Replies)
Discussion started by: Nagapandi
4 Replies

4. UNIX for Dummies Questions & Answers

A Shift into UNIX

Hi, Firstly, I did a search for this question both on this site and on the internet and have not been able to find a suitable answer that is not general in nature. I have always been a Windows user. I use my girl friend's mac every now and then, but I always come back to windows. For a... (1 Reply)
Discussion started by: mearex
1 Replies

5. Shell Programming and Scripting

Use of Shift command

Hello Expert Can any one please explain what is the use of shift command in general terms: set -- $(ls -t) shift rm -Rf $* what is the use of shift command over here. Thanks a lot for your help (2 Replies)
Discussion started by: aks_1902
2 Replies

6. Shell Programming and Scripting

Shift command help

#!/bin/bash hostname=$1; shift for hostname in $1 do ping $hostname done I want to run the above script as hostname.sh yahoo.com google.com cnn.com. I want to shift each hostname to $1. How can do that with above code as currently it's not shifting. (5 Replies)
Discussion started by: scj2012
5 Replies
MAIL(1) 						      General Commands Manual							   MAIL(1)

NAME
mail - send and receive electronic mail SYNOPSIS
mail [-dpqrv] [-f file] [user] OPTIONS
-d Force use of the shell variable MAILER -f Use file instead of /usr/spool/mail/user as mailbox -p Print all mail and then exit -q Quit program if SIGINT received -r Reverse print order, i.e., print oldest first -v Verbose mode EXAMPLES
mail ast # Send a message to ast mail # Read your mail DESCRIPTION
Mail is an extremely simple electronic mail program. It can be used to send or receive email on a single MINIX system, in which case it functions as user agent and local delivery agent. If the flag MAILER is defined in mail.c, it can also call a transport agent to handle remote mail as well. No such agent is supplied with MINIX. When called by user with no arguments, it examines the mailbox /usr/spool/mail/user, prints one message (depending on the -r flag), and waits for one of the following commands: <newline> Go to the next message - Print the previous message !command Fork off a shell and execute command CTRL-D Update the mailbox and quit (same as q) d Delete the current message and go to the next one q Update the mailbox and quit (same as CTRL-D) p Print the current message again s [file] Save message in the named file x Exit without updating the mailbox To send mail, the program is called with the name of the recipient as an argument. The mail is sent, along with a postmark line containing the date. For local delivery, a file named after the recipient in the directory /usr/spool/mail must be writable. If the directory /usr/spool/mail does not exist then the mail is dumped on the console, so that system programs have a way to notify a user on a system that does not have a mail spool. MAIL(1)
All times are GMT -4. The time now is 06:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy