Skip to content

Instantly share code, notes, and snippets.

@kevinzhang96
Created November 6, 2015 09:31
Show Gist options
  • Save kevinzhang96/1fd275cfb1e0fbd8cf61 to your computer and use it in GitHub Desktop.
Save kevinzhang96/1fd275cfb1e0fbd8cf61 to your computer and use it in GitHub Desktop.
Shell redirection system calls
echo foo > output.txt
open("output.txt", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 3
echo foo < output.txt
open("output.txt", O_RDONLY|O_LARGEFILE) = 3
echo foo 2> output.txt
open("output.txt", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment