Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to write contents of a pipe?

Posted on 1998-08-25
5
Medium Priority
?
279 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 100 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.
Suggested Courses

610 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