Haven't worked any of the examples in a while, but I do remember that echo $? is the command line to display the exit status of the program, so you can only view one result using the command. I suspect that the second echo $? is displaying the exit status of the first echo command, but I'm not knowledgeable enough of the linux programming environment to say for sure. One of the exercises is to rewrite the maximum program to find the minimum instead, but not both. You might try that one to see how the logic differs, Displaying both would be an interesting problem to solve, perhaps there is a way to access the contents of a different register from the command line and you could store the second result there? Good luck!
p.s. sorry the code attachment was blocked, so if I have misunderstood what you were trying to do, I apologize. Note: forwarded message attached.
--- Begin Message ---Hi there I am currently reading the book. When I finished first 3 chapters, i was trying to write a similar program as "findiing the maximun number. However, I want my program to not only find the maximun but also the minimun. Anyway, when I run my program and tried to output the two numbers, the program always gave me the maximun. --------------------------------------------------------- For example. 1st echo $? the maximun 2nd echo $? 0 ----------------------------------------------------------- My question is how can I use "echo $?" to give me both max and min, and how can I define a string of number of positive and negative numbers. Can you give me some advice ? Best regard. ps. I work under the linux OS. And the attached file is my program.
tryout.s.s
Description: Binary data_______________________________________________ Pgubook-readers mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/pgubook-readers
--- End Message ---
_______________________________________________ Pgubook-readers mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/pgubook-readers
