Sponsored Content
Full Discussion: at reminder script
Homework and Emergencies Homework & Coursework Questions at reminder script Post 302560719 by csharp100 on Friday 30th of September 2011 04:16:30 PM
Old 09-30-2011
Quote:
Originally Posted by Corona688
Show me exactly what you tried.

---------- Post updated at 02:02 PM ---------- Previous update was at 02:00 PM ----------

I think I understood in the first place.

write is trying to terminal commands on a non-terminal device(being run from 'at', it has no terminal!) which isn't the end of the world, but also blabs error messages when it does, which isn't what you want.

The redirection I showed you ought to work, but may have gone into the wrong place, can you show me exactly what you tried?
I tried,
Code:
 write $LOGNAME < ~/Msgs/message.$$ > /dev/null 2>dev/null

and
Code:
 write $LOGNAME < ~/Msgs/message.$$ > /dev/null 2>&1

I did take out the
Code:
 || mail $LOGNAME < ~/Msgs/message.$$

on both tries.
When I tried both, I got the same message mailed to me and did not get my write message at all. It also included an "Ambiguous redirection" in the mail messages as well.
 

2 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

Reminder script not working...

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: We have been tasked to write an at reminder script that will write or echo a message to more than one user. What... (11 Replies)
Discussion started by: csharp100
11 Replies

2. OS X (Apple)

A simple reminder script for beginners to shell scripting.

(Apologies for any typos.) Well hands up those who have been in the following situation(s):- Your partner, (in my case the missus), sees that you are messing with your machine and says something like, "can you keep an eye on the dinner, I am going out shopping", and you look up glazed eyed... (3 Replies)
Discussion started by: wisecracker
3 Replies
mesg(1) 							   User Commands							   mesg(1)

NAME
mesg - permit or deny messages SYNOPSIS
mesg [-n | -y | n | y] DESCRIPTION
The mesg utility will control whether other users are allowed to send messages via write(1), talk(1), or other utilities to a terminal device. The terminal device affected is determined by searching for the first terminal in the sequence of devices associated with standard input, standard output, and standard error, respectively. With no arguments, mesg reports the current state without changing it. Processes with appropriate privileges may be able to send messages to the terminal independent of the current state. OPTIONS
The following options are supported: -n|n Denies permission to other users to send message to the terminal. See write(1). -y|y Grants permission to other users to send messages to the terminal. ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of mesg: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 if messages are receivable. 1 if messages are not receivable. 2 on error. FILES
/dev/tty* terminal devices /dev/pts/* terminal devices ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
talk(1), write(1), attributes(5), environ(5), standards(5) SunOS 5.11 31 Oct 1997 mesg(1)
All times are GMT -4. The time now is 12:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy