Reputation: 225
I know that environment variables are stored in the processes memory but what format are command line arguments stored in?
Upvotes: 0
Views: 169
Reputation: 11
In Linux, command line arguments are pushed on the stack with the count of arguments being on top of the stack. If you write an assembly language program, then you can read the command line arguments by popping them from the stack.
Upvotes: 1
Reputation: 39838
They're just stored with the environment as (more) null-terminated strings. Some software has been known to write to them (among other techniques) to display status information via ps(1)
.
Upvotes: 0