PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs323] status var and cd
Date: Friday, 20 Nov 2020, 07:49:43


    > Message Posted By: Unknown
    >
    > Can you give an example of a command where "printenv ?" would not print 0?

Try

  (1)$ /c/cs323/Hwk5/Tests/exit 9 ; printenv ?
=====

    > I am not able to think of one that isn't very basic. Also why does
    > "non_existent_file | printenv ?" print a 0? shouldn't it print the status
    > returned from the process that called  non_existent_file?

Because the error from execvp() occurs in a child
process.

Try

  (1)$ nonexistent ; printenv ?

instead.
=====

    > Also, in terms of the built-in commands description on the spec, does this
    > mean that a built in command must be on its own line with nothing else in
    > it (subcmd, pipeline, etc.)?

No.  Try

  (1)$ cd -p ; cd / ; cd -p

--Stan-
PREV INDEX NEXT