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
WRITE(1)						     Linux Programmer's Manual							  WRITE(1)

NAME
write - send a message to another user SYNOPSIS
write user [ttyname] DESCRIPTION
Write allows you to communicate with other users, by copying lines from your terminal to theirs. When you run the write command, the user you are writing to gets a message of the form: Message from yourname@yourhost on yourtty at hh:mm ... Any further lines you enter will be copied to the specified user's terminal. If the other user wants to reply, they must run write as well. When you are done, type an end-of-file or interrupt character. The other user will see the message EOF indicating that the conversation is over. You can prevent people (other than the super-user) from writing to you with the mesg(1) command. Some commands, for example nroff(1) and pr(1), may disallow writing automatically, so that your output isn't overwritten. If the user you want to write to is logged in on more than one terminal, you can specify which terminal to write to by specifying the ter- minal name as the second operand to the write command. Alternatively, you can let write select one of the terminals - it will pick the one with the shortest idle time. This is so that if the user is logged in at work and also dialed up from home, the message will go to the right place. The traditional protocol for writing to someone is that the string `-o', either at the end of a line or on a line by itself, means that it's the other person's turn to talk. The string `oo' means that the person believes the conversation to be over. SEE ALSO
mesg(1), talk(1), who(1) HISTORY
A write command appeared in Version 6 AT&T UNIX. 12 March 1995 WRITE(1)
All times are GMT -4. The time now is 05:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy