Sponsored Content
Homework and Emergencies Homework & Coursework Questions Reminder script not working... Post 302569796 by csharp100 on Tuesday 1st of November 2011 02:59:19 PM
Old 11-01-2011
Quote:
Originally Posted by vbe
Clue:
How are you going to get the $tty ?
Portion corrected
Code:
who | grep $LOGNAME | sed 's,.*\(pts/[0-9]*\).*, \1 ,' |
while read tty
do
  echo $MESSAGE | /dev/$tty
done
 
#
execution:
#
an12:/home/vbe $ who | grep $LOGNAME | sed 's,.*\(pts/[0-9]*\).*, \1 ,'|
> while read tty
> do
>   echo $MESSAGE | /dev/$tty
> done
/usr/bin/ksh[4]: /dev/pts/14: 0403-006 Execute permission denied.
/usr/bin/ksh[4]: /dev/pts/24: 0403-006 Execute permission denied.
/usr/bin/ksh[4]: /dev/pts/27: 0403-006 Execute permission denied.

You carry on now...
I believe I know where you are going. I used the above for loop instead but I think you are pointing out the fact that some users might have there tty's turned off for receiving messages. Is that correct? My time was limited on getting the assignment done. I had thought of that though.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script not working.

Hi, I am a DBA, worked on Windows platforms for past 6 years, and now shifted in environment where HP UX is OS environment. I have task to complete which involves Unix script to be prepared. This script should FTP the file to the destination server and if this FTP fails, then it should... (5 Replies)
Discussion started by: Nishchal_Nagre
5 Replies

2. Shell Programming and Scripting

Script not working..."sort" not working properly....

Hello all, I have a file - 12.txt cat 12.txt =============================================== Number of executions = 2 Total execution time (sec.ms) = 0.009883 Number of executions = 8 Total execution time (sec.ms) = 0.001270 Number of... (23 Replies)
Discussion started by: Rahulpict
23 Replies

3. Shell Programming and Scripting

Perl script 'system' linking to local shell script not working

Trying to figure out why this works: printpwd.pl #!/usr/bin/perl use CGI::Carp qw( fatalsToBrowser ); print "Content-type: text/html\n\n"; $A = system("pwd"); $A = `pwd`; print "$A\n"; ^^actually that works/breaks if that makes any sense.. i get the working directory twice but when... (5 Replies)
Discussion started by: phpfreak
5 Replies

4. UNIX for Dummies Questions & Answers

script not working

hi guys im new to unix and what to get this script working the scripts purpose its purpose is to move files i copy it from a HP UX pdf just for practice but when i execute it comes up wit this error command not found on the line if plz help me and thank in advance to those who do ps im... (3 Replies)
Discussion started by: ShinTec
3 Replies

5. Shell Programming and Scripting

Script is not working from cron while working manually

Hello, I am facing a very strange problem when I run my script manuallu ./Fetchcode which is using to connect with MKS integrity from linux end it workks fine but when I run it from cron it doesn't work.Can someone help me 1) How could I check my script when it is running from cron like... (3 Replies)
Discussion started by: anuragpgtgerman
3 Replies

6. Shell Programming and Scripting

Script not working in cron but working fine manually

Help. My script is working fine when executed manually but the cron seems not to catch up the command when registered. The script is as follow: #!/bin/sh for file in file_1.txt file_2.txt file_3.txt do awk '{ print "0" }' $file > tmp.tmp mv tmp.tmp $file done And the cron... (2 Replies)
Discussion started by: jasperux
2 Replies

7. Shell Programming and Scripting

expect script inside shell script not working.

Shell Scipt: temp.sh su - <$username> expect pass.exp Expect script: pass.exp #!/usr/bin/expect -f # Login ####################### expect "Password: " send "<$password>\r" it comes up with Password: but doesnt take password passed throguh file. (2 Replies)
Discussion started by: bhavesh.sapra
2 Replies

8. Shell Programming and Scripting

Script not working

Hi i have write the one scripts and the scripts is error. The scripts purpose select one directory to check the file is there or not. i will give the two format of file to search the mention the path one file is there to select the file one copy the another location.please check the my script give... (1 Reply)
Discussion started by: rajivgandhi
1 Replies

9. UNIX for Beginners Questions & Answers

Why is this script not working?

for file in $(find /home/p611568/*.rpt -mtime -2 | grep -v ftplog) do awk '$1 == "XifPages," {PAGE = $5} $1 == "XifEndOfDocuments," {LINE = $5} index($0,"Value") && index($1,"Info") {sevGTI = 1} END {if (sevGTI) printf "%7s%10s%s",PAGE,LINE ... (4 Replies)
Discussion started by: bcarosi
4 Replies

10. Shell Programming and Scripting

Help with speeding up my working script to take less time - how to use more CPU usage for a script

Hello experts, we have input files with 700K lines each (one generated for every hour). and we need to convert them as below and move them to another directory once. Sample INPUT:- # cat test1 1559205600000,8474,NormalizedPortInfo,PctDiscards,0.0,Interface,BG-CTA-AX1.test.com,Vl111... (7 Replies)
Discussion started by: prvnrk
7 Replies
XTELLD(8)						      System Manager's Manual							 XTELLD(8)

NAME
xtelld - daemon receiving messages from xtell(1) clients SYNOPSIS
xtelld [options] DESCRIPTION
xtelld is daemon receiving messages from the xtell(1) client and displaying them to apropriate user. OPTIONS
--help Short help --alone Force server to run standalone --inetd Force server to act as service of inetd --version Print version information and exit. -sX Lifetime for spawned services (in seconds) ex: -s25 maintain connections for up to 25 seconds -mX Spawn no more than X children services at a time ex: -m15 service no more than 15 requests at once. Note: ignored if inetd service -pX Use port X, default: 4224 -n Do not lookup addresses, use IP numbers instead USAGE
Xtell daemon can run either from inetd(preferred) or from command line. If you decide to start it from inetd, add this line to /etc/ser- vices : xtell 4224/tcp # xtell server and this line to /etc/inetd.conf : xtell stream tcp nowait nobody.tty /usr/sbin/tcpd /usr/local/sbin/xtelld Notice that the entries are separated by tabs, not spaces. Restart inetd with killall -HUP inetd What to do if you are a normal user and want to run xtell daemon: You can't run it from inetd, obviously. Just start ./xtelld to use xtell on default port (4224). In this case, xtell can write messages only to you. If there is another user on that system willing to get messages, either s/he starts xtelld on another port (e.g. ./xtelld -p4225), or makes his/her tty writable by you (e.g. chmod a+rw /dev/tty* /dev/pts/*) AUTHOR
Radovan Garabik (garabik@fmph.uniba.sk) SEE ALSO
xtell(1), write(1), talk(1), talkd(8), tty(1) XTELLD(8)
All times are GMT -4. The time now is 02:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy