Sponsored Content
Special Forums UNIX Desktop Questions & Answers Wall, Write, select users, pipe a text file, HELP Before I'm Bald! Post 302175324 by chimodel on Thursday 13th of March 2008 04:52:36 PM
Old 03-13-2008
Wall, Write, select users, pipe a text file, HELP Before I'm Bald!

OK... I'm fairly new to unix having the admin handed to me on a platter w/almost no training.
However, being a programmer, I do pick up things fairly easily, but this one is getting the best of me.

I have a unix server that runs multiple versions of the same ERP system, hand crafted for our company.
This system is accessed by our users via telnet pro and automatically brings up an ascii style menu driven by PFkeys.

Each version of this program is defined by "comany".
During our month end process, I need to send a message to ONLY the users of a Specific company.

I've gotten to the point where I can identify all the users of a specific company and grab their tty... however... if I use the write command generically
(write blk < "/usr2/db/etc/tst1" >/dev/pts/244 2>/dev/null & )
even directing it to a specific tty... it always sends it to the initial login and sends the "you're also logged in at..." message to the other instances.

If I use the write command with the -n variable
(write -n c1f1n4.conagra.cag blk pts/244 < /usr2/db/etc/tst1)
... it grabs the correct terminal... but I can't seem to feed the precreated text file to dump to it as I can with the write command with no variables.

I've tried the wall command with similar results... I have to designate the group (as I could create groups based on the company)
(wall -g megvf /usr2/db/etc/tst1)
but again... though the wall command SAYS you can use a filename... it doesn't dump the file, but simply seems to put out the path/filename I typed in as the parameter.

I've tried the tee command too... echo doesn't use a predefined file... the pg command seems to work to an extent
(pg /usr2/db/etc/tst1 | tee /dev/pts/244)
but it also pages to the sending terminal and I'm not sure what that would do if run inside a script.

Not only that... but ALL of the above... except the wall command... do not overwrite the menu the user is viewing when logged in, and all seem to freeze up the users system.

Help... I'm pulling my hair out.
Suggestions or better yet an exact script sample would be great.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

using the wall or write cmd

Hi all, i'm trying to generate a "pop up window" incorporating either the write or wall command or both. Is such a thing possible ? thanks simon2000 (2 Replies)
Discussion started by: simon2000
2 Replies

2. Programming

Problems with pipe(...); using select(...);

Hello all, My problem is as follows: I'm trying to wake up a select(...); using a pipe fd. This should be rather straightforward, but I cannot get it to work. Perhaps you guys could give me a few tips. My wakeup function looks like this: STATIC void net_trig_wr() { /* write a dummy... (0 Replies)
Discussion started by: ne2000
0 Replies

3. UNIX for Dummies Questions & Answers

Threads with pipe and select?

Hi. I just found this site while searching for some info on a problem and thought I'd see if anyone else knows the answer. I have two threads that are connected by a pipe. Thread A can write to the pipe and Thread B can read the data from the pipe. My problem is that when I use select() in... (3 Replies)
Discussion started by: willil
3 Replies

4. Cybersecurity

file permission/acl: 2 users with write access on 1 file...

Hello, i need some help/advice on how to solve a particular problem. these are the users: |name | group | ---------- --------------- |boss | department1 | |assistant | department1 | |employee | department1 | |spy | department2 | this is the... (0 Replies)
Discussion started by: elzalem
0 Replies

5. Shell Programming and Scripting

random select text file ranamed

i want to need script.. source.txt /home/user1/public_html/test3 /home/user90/public_html/test9 . . . /home/user650/public_html/test000 read source.txt and cd /home/user**/public_html/*** and there is 1.txt, 2txt ~~25.txt and select 6 text files randomly among the... (4 Replies)
Discussion started by: topic32428285
4 Replies

6. Fedora

wall and write commands are not working

hi friends i am using fedora linux operating system on the server and two clients(with windows os) are connected to it(server ).but here wall and write cmds are not working to send messages from one system to another system . pls help me (4 Replies)
Discussion started by: sankar_vitam
4 Replies

7. Shell Programming and Scripting

Write in a file with pipe also in same line

hi, i want to write in a file the output of one command and pile also the same output like ls -lrt > some_file | wc -l (9 Replies)
Discussion started by: narang.mohit
9 Replies

8. UNIX for Dummies Questions & Answers

Write to file using tail -f through a pipe to grep

Hi -- I'm looking to write to a file after piping output from tail -f through to grep: #write to a file for all lines with "searchtext" within in error_log: Expand|Select|Wrap|Line Numbers tail -f /var/error_log | grep searchtext > output.txt The above command... (2 Replies)
Discussion started by: ndedhia1
2 Replies

9. UNIX for Dummies Questions & Answers

How to randomly select lines from a text file

I have a text file with 1000 lines, I want to randomly select 200 lines from it and print them as output. How do I go about doing that? Thanks! (7 Replies)
Discussion started by: evelibertine
7 Replies

10. Shell Programming and Scripting

Select row from file and text

Hi all! I would like to solve a problem but I have no clue of how do it!I will be grateful if someone could help me! Briefly I have a big file like this: >ENSMUSG00000000204 | ENSMUST00000159637 GGCGAGGCTTACGCCATTTTACCTCAGCGAGCATTCATAAAGCTGCGAGCATTCATACAG >ENSMUSG00000000204 |... (3 Replies)
Discussion started by: giuliangiuseppe
3 Replies
wall(1M)						  System Administration Commands						  wall(1M)

NAME
wall - write to all users SYNOPSIS
/usr/sbin/wall [-a] [-g grpname] [filename] DESCRIPTION
wall reads its standard input until an end-of-file. It then sends this message to all currently logged-in users preceded by: Broadcast Message from ... If filename is given, then the message is read in from that file. Normally, pseudo-terminals that do not correspond to rlogin sessions are ignored. Thus, when using a window system, the message appears only on the console window. However, -a will send the message even to such pseudo-terminals. It is used to warn all users, typically prior to shutting down the system. The sender must be superuser to override any protections the users may have invoked See mesg(1). wall runs setgid() to the group ID tty, in order to have write permissions on other user's terminals. See setuid(2). wall will detect non-printable characters before sending them to the user's terminal. Control characters will appear as a " ^ " followed by the appropriate ASCII character; characters with the high-order bit set will appear in "meta" notation. For example, `03' is dis- played as `^C' and `372' as `M-z'. OPTIONS
The following options are supported: -a Broadcast message to the console and pseudo-terminals. -g grpname Broadcast to the users in a specified group only, per the group database (see group(4)). ENVIRONMENT VARIABLES
If the LC_* variables (LC_CTYPE, LC_TIME, LC_COLLATE, LC_NUMERIC, and LC_MONETARY) are not set in the environment, the operational behav- ior of wall for each corresponding locale category is determined by the value of the LANG environment variable. See environ(5). If LC_ALL is set, its contents are used to override both the LANG and the other LC_* variables. If none of the above variables are set in the envi- ronment, the "C" (U.S. style) locale determines how wall behaves. FILES
/dev/tty* ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
mesg(1), write(1), setuid(2), attributes(5), environ(5) NOTES
wall displays ``Cannot send to ...'' when the open on a user's tty file fails. SunOS 5.10 13 Jul 1994 wall(1M)
All times are GMT -4. The time now is 12:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy