-
Command Input:
- The user types
ls -l
in the terminal, and the shell reads this input.
- The user types
-
Command Parsing & PATH Variable:
- The shell parses the command and its arguments.
- The shell searches for the
ls
binary in the directories listed in the PATH environment variable.
-
Permission & Access Check:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'll be omitting syscalls with ellipsis. | |
The first thing that happens after you press enter is that bash resolves | |
curl to /usr/bin/curl and then forks(). The strace output is from the | |
forked process. | |
Fist execve() the /usr/bin/curl binary and pass an array of arguments to it. | |
execve("/usr/bin/curl", ["curl", "http://github.com"], [/* 8 vars */]) = 0 | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configure Ruby and Gems paths on Mac | |
export RUBY_PATH=/usr/local/opt/ruby/bin | |
export PATH="$RUBY_PATH:$PATH" | |
export RUBY_VERSION=$($RUBY_PATH/ruby -e "puts RUBY_VERSION") | |
export PATH="/usr/local/lib/ruby/gems/$RUBY_VERSION/bin:$PATH" | |
export GEM_HOME="$HOME/.gem" | |
export GEM_PATH="$GEM_HOME/ruby/$RUBY_VERSION" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input = [[1,2,3], | |
[3], | |
[4], | |
[5,6], | |
[1,7], | |
[2,8], | |
[4,9]] | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCz7oMPKkaM3s4Q1t1lZ9V4HPxeh9OtMIVEfzl7vmcEDRORAu7ne5NKww7KbFHPJdl1USF59ZY1W1ANu8hqRHIdKbUptASWBTGSkDWrDEF467YEwio/ONRHgStjvy6Z1xI2yltaouyz6+p21GfPY7/miXOSBmPy5ObuUcBgz+hLullq50hi0uLCkoYPH4p9uTtW0gMR9h7N06AZPb8sh1+vQOAA9QMc00XaahVlwwdZDKvYL4mOh7yCIHUSJojaTugwEngCJNDegwRBn8OAML0awY5daKaAON5PQx4qAqAsGrl10yyZmtaK4Ec3LSD6IYAT950x0gimKN0P4rBSFJ0XSGfQH5hcCpQCshncS6ivmvKR0V8Zr5TEUKymYvgCjA0q5n4Mkx4vl3M3WpOt5hv7nLfWlzNlnK17Kdn2c3fJiHu/eR/mO6R1e2L/Bn6s3uTimoNDmajpgfsYPqPragYPoI3TP5OTp+m5QL2YFVl6IySuGHZIvxp8HTrr4KwgYvnOEvUfjWofP1YstwvWNPSDhs9zQqO6Ka0VNXiQNWBVDSonG9JUU7mh9LQl7ieHKqojj1gbj6tUXY+yxboVCPwc/lBdl+fQdNTCOFFB8K0SJBcO/sEZaepCC4ZPp1ExKbgjAOnBFLYj70zC1vwMsOLycH+nQ18nIyIGHG07TOdnQ== baurzhan@MacBook-Pro.home |
OlderNewer