Guest User

Untitled

a guest
May 18th, 2012
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  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. ...
Advertisement
Add Comment
Please, Sign In to add comment