Wall, Write, select users, pipe a text file, HELP Before I'm Bald!


 
Thread Tools Search this Thread
Special Forums UNIX Desktop Questions & Answers Wall, Write, select users, pipe a text file, HELP Before I'm Bald!
# 1  
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.
# 2  
Old 03-13-2008
try using a pipe?

try
Code:
cat sometextfile | wall

also you wouldn't want to "quote" the path when you're using shell redirect.
so
Code:
wall < "/path/to/file"

would cause that to be a literal string.

Code:
wall < /path/to/file/

should work fine.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
Login or Register to Ask a Question