Thread: Linux equivalent of con

  1. #1
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057

    Linux equivalent of con

    What is the Linux equivalent of con?

    For example, in DOS, if a program requires a file as input, you can use "con" as the filename, and it will read data from the keyboard.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  2. #2
    Sr. Software Engineer filker0's Avatar
    Join Date
    Sep 2005
    Location
    West Virginia
    Posts
    235
    It all depends on what you want. "/dev/tty" should get you the user terminal, though this is not always the Linux console -- it may be an X-Term. If you're trying for the system console, I believe that "/dev/console" is what you need. You may not have access as a user to the system console, however.

  3. #3
    Me -=SoKrA=-'s Avatar
    Join Date
    Oct 2002
    Location
    Europe
    Posts
    448
    Usually, when passing arguments to a program, you can usually specify - (a dash) as the filename. This has to be implemented by the program, though.

    If you're writing a program, use stdin, but that's standard C.
    SoKrA-BTS "Judge not the program I made, but the one I've yet to code"
    I say what I say, I mean what I mean.
    IDE: emacs + make + gcc and proud of it.

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Okay, thanks. I'll have to implement the - filename.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Equivalent to volume serial number in linux
    By Elkvis in forum Linux Programming
    Replies: 8
    Last Post: 06-30-2009, 08:46 PM
  2. ReadProcessMemory/WriteProcessMemory Linux equivalent?
    By MrLucky in forum C++ Programming
    Replies: 7
    Last Post: 07-27-2007, 09:36 AM
  3. Linux equivalent to Win32 ShellExecute
    By BobS0327 in forum Linux Programming
    Replies: 4
    Last Post: 06-07-2006, 04:35 AM
  4. Linux equivalent to CreateDirectory
    By Rak'kar in forum Linux Programming
    Replies: 2
    Last Post: 07-10-2004, 12:04 PM
  5. .bat equivalent for linux
    By ichijoji in forum Linux Programming
    Replies: 8
    Last Post: 03-07-2004, 08:06 AM