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) 						    BSD General Commands Manual 						   MESG(1)

NAME
mesg -- display (do not display) messages from other users SYNOPSIS
mesg [n | y] DESCRIPTION
The mesg utility is invoked by a user to control write access others have to a terminal device. Write access is allowed by default, and pro- grams such as talk(1) and write(1) may display messages on the terminal. The first terminal device in the sequence of devices associated with standard input, standard output and standard error is affected. Options available: n Disallows messages. y Permits messages to be displayed. If no arguments are given, mesg displays the present message status to the standard output. EXAMPLES
Disallow messages from other users to the current terminal: mesg n Allow messages from other users to ttyp1 (assuming you are also logged in on that terminal): mesg y </dev/ttyp1 DIAGNOSTICS
The mesg utility exits with one of the following values: 0 Messages are allowed. 1 Messages are not allowed. >1 An error has occurred. COMPATIBILITY
Previous versions of the mesg utility wrote the message status to the standard error output and affected the terminal attached to standard error without first trying the standard input or output devices. SEE ALSO
biff(1), talk(1), wall(1), write(1) STANDARDS
The mesg utility conforms to IEEE Std 1003.1-2001 (``POSIX.1''). HISTORY
A mesg command appeared in Version 1 AT&T UNIX. BSD
May 5, 2002 BSD
All times are GMT -4. The time now is 02:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy