Solved

How to write contents of a pipe?

Posted on 1998-08-25
5
277 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
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…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

707 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