Author Topic: command output to command input?  (Read 821 times)

Stryker

  • VIP
  • Member
  • ***
  • Posts: 1,258
  • Kudos: 41
command output to command input?
« Reply #15 on: 23 August 2002, 13:55 »
that wasn't the point though. And system("ls") would depend on what #includes you have in the program, i believe there is one other way to do it with a different header file.

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
command output to command input?
« Reply #16 on: 23 August 2002, 14:06 »
quote:
Originally posted by Stryker:
Alright, i'll look up docs on that, and voidman, you abondoned my post for the laptop.   :confused:   still dont know what to do about the dvd.


No I didn't, I asked you to create a symbolic link for /dev/dvd that points to /dev/hdc as the DVD HOWTO states.  I don't have a DVD drive so I can't be sure.  Again the command is:

# ln -s /dev/hdc /dev/dvd
Someone please remove this account. Thanks...

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
command output to command input?
« Reply #17 on: 23 August 2002, 14:11 »
quote:
Originally posted by Stryker:
All I want to accomplish is the knowledge of how to send the output of command A to the input of command B. I dont have any specific goal in mind anymore, I just want to learn something new. And this is 1 thing I know how to do in windows but not linux. I'm not so sure how I could get really detailed about it. lets say I make a program that records all the input it gets, and once it stops recieving input for more than 2 seconds it closes. how would I send 'ls' to that program?


If you want to write a command in C that can be piped to then you need to open the special file "STDIN".  This is very easy to do and you don't want to write it so it times out after 2 seconds (at least I can't imagine that you would).

[ August 23, 2002: Message edited by: VoidMain ]

Someone please remove this account. Thanks...