Question: Use execve to write a program called myls whose behavior is identical to the ( ) / ( b ) i ( n ) /
Use execve to write a program called myls whose behavior is identical to theb
inls program. Your program should accept the same commandline argu
ments, interpret the identical environment variables, and produce the identical
output.
The ls program gets the width of the screen from the COLUMNS environ
ment variable. If COLUMNS is unset, then s assumes that the screen is
columns wide. Thus, you can check your handling of the environment variables
by setting the COLUMNS environment to something less than :
linux setenv COLUMNS
linuxmyls
: Output is columns wide
linux unsetenv COLUMNS
linuxmyls
: Output is now columns wide
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
