LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-11-2015, 02:10 AM   #1
VaniJ
LQ Newbie
 
Registered: May 2015
Posts: 6

Rep: Reputation: Disabled
Write to pipe file hangs (using echo command)


HI,

I am a newbie to Linux and am trying to create a pipe file with the below command:

mkfifo pone

Now I am trying to write data to the file with the following command on the command prompt:

echo asdadsasdasdasdasdasd >./pone

But after i enter this command- the screen hangs up and doesnt proceed ahead.
Same thing happened when I tried writing using:
gedit pone


Can anyone help me resolve this issue?
 
Old 05-11-2015, 02:11 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,450

Rep: Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776
is there any other process reading that pipe?
 
Old 05-11-2015, 02:13 AM   #3
VaniJ
LQ Newbie
 
Registered: May 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
is there any other process reading that pipe?
None.
I am using a virtual machine and have just opened a terminal and typed these commands.
 
Old 05-11-2015, 02:29 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,450

Rep: Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776
in that case most probably the buffer of that fifo is full. You need to read the content by for example cat pone in another terminal.
 
Old 05-11-2015, 02:31 AM   #5
VaniJ
LQ Newbie
 
Registered: May 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
Unhappy

Quote:
Originally Posted by pan64 View Post
in that case most probably the buffer of that fifo is full. You need to read the content by for example cat pone in another terminal.
typing cat pone on the terminal also has same result.
The screen just hangs until i do a Ctrl+C
 
Old 05-11-2015, 02:43 AM   #6
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,450

Rep: Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776
yes, sure, cat pone will wait for input. You need to open another terminal and write into the pipe (that is the echo command you posted)
 
1 members found this post helpful.
Old 05-11-2015, 03:13 AM   #7
VaniJ
LQ Newbie
 
Registered: May 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by pan64 View Post
yes, sure, cat pone will wait for input. You need to open another terminal and write into the pipe (that is the echo command you posted)
Oh that worked perfectly well..
THough - since I am a newbie i am not sure what exactly is it that you made me do :-|
I will search online for the command 'cat' and figure that out.
Thanks a ton!

-Vani
 
Old 05-11-2015, 03:51 AM   #8
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,450

Rep: Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776
you can also check the man page of cat, man page of mkfifo and https://en.wikipedia.org/wiki/FIFO_2...electronics%29 and https://en.wikipedia.org/wiki/Named_pipe (and of course you can find more useful info too)
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] edit file using echo command sachin.davra Linux - Newbie 17 01-18-2014 09:00 AM
echo command didn't pipe the output to the msmtp? shams Programming 8 03-01-2013 11:10 PM
Pipe 'echo' to 'netcat' - sometime it seems to broken quanta Linux - Server 2 09-05-2010 09:16 PM
how to pass pipe output to file command nickleus Linux - General 6 06-19-2008 06:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration