Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 18th, 2012  |  syntax: None  |  size: 0.52 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to get input file name from Unix terminal in C?
  2. $./sort 1 < test.txt
  3.        
  4. $ echo "This is the end" | ./sort 1
  5.        
  6. echo $(readlink /proc/self/fd/0 < /dev/null)
  7.        
  8. /dev/null
  9.        
  10. sort << _EOF
  11. 3
  12. 1
  13. 2
  14. _EOF
  15.        
  16. $ /usr/bin/sleep 3600 < /tmp/foo &
  17. [1] 8430
  18. $ pfiles 8430
  19. 8430: /usr/bin/sleep 3600
  20.   Current rlimit: 65536 file descriptors
  21.    0: S_IFREG mode:0600 dev:299,2 ino:36867886 uid:12345 gid:67890 size=123
  22.       O_RDONLY|O_LARGEFILE
  23.       /tmp/foo
  24.    1: S_IFCHR mode:0600 dev:295,0 ino:12569206 uid:12345 gid:67890 rdev:24,2
  25. ...