Solved

How to write contents of a pipe?

Posted on 1998-08-25
5
274 Views
Last Modified: 2011-09-20
Hwo can I write a script in a file created by mknod file p. inside of this pipe I want to put a script and I will chamge its permission. I tried to write in a pipe file but it seems impossible. Sugesstions?!
0
Comment
Question by:mega_tron
5 Comments
 
LVL 2

Expert Comment

by:kellyjj
ID: 2006787
do it in C.
0
 

Expert Comment

by:izar
ID: 2006788
A pipe isn't really a file, it is a way of doing IPC (interprocess communication). For a pipe to be effective, you need a writer and a listener, that can be or not the same process. More to the tone of your question, you can't "write a script in a file created by mknod file p" because it is not a file - it has no inode storage.
You probably need to rethink your approach to the problem.
0
 

Author Comment

by:mega_tron
ID: 2006789
izar,
 you are right, I was not aproaching real well to the idea that was hammering in my mind. I want to write a pipe(or script) that can be executed while somebody is fingering me(using finger*). At finger(I am just a normal user -- If I was root I can do better than ever) I have the control of two files .plan and .project. I there any way that by using these files I can make a script running. If yes any suggestion??
0
 

Accepted Solution

by:
tphipps earned 50 total points
ID: 2006790
This is much easier to do in a very basic C program than a shell script.  Checkout this example:

http://www.twisted-helices.com/computing/plan/plan.html

Remember that your dynamic .plan program will need to be always running on your machine (and waiting to receive requests), instead of being started each time you are fingered - there's no easy way to start a new program each time a finger request comes through.  However this will give you an easy way to do things when you're fingered.

0
 
LVL 5

Expert Comment

by:ecw
ID: 2006791
Easy enough to do as a script eg.
 #!/usr/bin/sh
 trap 'rm -f "$HOME/.plan" ; exit 0' 0 2 3 15
 rm -f "$HOME/.plan" ; mknod -p "$HOME/.plan"
 while : ; do
  echo "Auto plan @ `date`" > "$HOME/.plan"
 done
Start it in the background, and go home.  It will cause problems if the machine is rebooted.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now