Add the exit status of the previous command to your prompt so it behaves similarly to the following:

$ [0] ls xxx
ls: xxx: No such file or directory
$ [1]


The following command sets up the prompt described in the question:
PS1='[$?]

Computer Science & Information Technology

You might also like to view...

What are the differences between the following commands?

a. i and I b. a and A c. o and O d. r and R e. u and U

Computer Science & Information Technology

Which of the Boolean expressions below is incorrect?

a. (true) && (3 => 4) b. !(x > 0) && (x > 0) c. (x > 0) || (x < 0) d. (x != 0) || (x = 0) e. (-10 < x < 0)

Computer Science & Information Technology

A trigger object can be a graphic or text, and it can be clicked or moused over in order for the animation to occur

Indicate whether the statement is true or false

Computer Science & Information Technology

What is the administrative distance of a static route?

A) 110 B) 90 C) 100 D) 120 E) 1

Computer Science & Information Technology