LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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-21-2006, 11:05 AM   #1
intervade
LQ Newbie
 
Registered: May 2006
Posts: 9

Rep: Reputation: 0
Cat


Ok, I dont know if there is a really newbie question or what, but Im writing the output of a game server to a fifo file with

Code:
cat < server.out | ./hlds_l .... 2> /dev/null 1> /dev/null &
Ok, now, in order to stop the game server, I want to write "quit" to the output or game server buffer which is being directed to server.out, so I need to write "quit" to "server.out"

How can I do this with cat?
 
Old 05-21-2006, 11:17 AM   #2
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
The output is stdout, AKA as descriptor 1. So if you write "1> /dev/null", it's going absolutely nowhere.
 
Old 05-21-2006, 11:20 AM   #3
intervade
LQ Newbie
 
Registered: May 2006
Posts: 9

Original Poster
Rep: Reputation: 0
Well, me and a buddy were doing this before a while back, working on this thing. And it worked actualy, all we did was write "quit" to server.out, and it stoped the server, so how do I do this?
 
Old 05-21-2006, 11:26 AM   #4
dubz_444
Member
 
Registered: Mar 2006
Location: South Africa
Distribution: Arch Linux
Posts: 43

Rep: Reputation: 15
er...
echo quit > server.out
 
Old 05-21-2006, 11:26 AM   #5
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
OK, let's see if I get this. "cat < server.out" is in this case the same as "echo quit". So if you want to write that to a FIFO, what about "echo quit > fifofile"?
 
Old 05-21-2006, 11:31 AM   #6
intervade
LQ Newbie
 
Registered: May 2006
Posts: 9

Original Poster
Rep: Reputation: 0
didnt, seem to work. But, maybe there is another way, I want to control the game server with a fifo with starting and stopping because looking up the pid is too much work. So last time, me and my buddy, were using a fifo file and writing quit.

Any ideas?
 
Old 05-21-2006, 11:46 AM   #7
dubz_444
Member
 
Registered: Mar 2006
Location: South Africa
Distribution: Arch Linux
Posts: 43

Rep: Reputation: 15
what about using job numbers?

kill %1 -- job number 1
 
Old 05-21-2006, 02:18 PM   #8
intervade
LQ Newbie
 
Registered: May 2006
Posts: 9

Original Poster
Rep: Reputation: 0
Ok, I figured out most of this the commands Ive been using have been working, the problem is, its seeming to take more than one output just to get the first output

if I do

cat > server.out | echo quit

it will echo quit, but I then have to type the command AGAIN when Im in the output of server.out with cat.

so basicly it looks like this

cat > server.out | echo quit
quit

any ideas why this is happening?
 
  


Reply



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
My Cat unimaginative General 71 02-18-2004 01:08 PM
Cat ... Beuzekom Linux - Newbie 4 01-19-2004 05:32 PM
How much can a cat 5 cable take? klod Linux - Networking 4 08-04-2003 07:49 AM
cat notsoevil Linux From Scratch 3 02-14-2002 10:16 AM
regarding cat gui10 Linux - Security 6 12-07-2001 08:09 PM

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

All times are GMT -5. The time now is 08:28 AM.

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
Open Source Consulting | Domain Registration