Re: [S.u.S.E. Linux] Re: Re: Is this a Bash 2 problem?
![](https://seccdn.libravatar.org/avatar/64f8793c7ad0eef351592c4bdcc34aff.jpg?s=120&d=mm&r=g)
Hubert Thank you for the education! It shows that even an old programmer CAN learn. I was not aware of that nuance of pwd. Very interesting! I also learned that I have a new bunch of aliases I was not aware of. I had never aliased mkdir to md (maybe because of DOS) but see I have an alias now (md -p). From this discussion, I take it that I can forget your previous comment ie "Wayne's custom prompt only modified the PS1 variable. This is a dangerous thing because it can fake the return value of commands when the prompt contains a command itself." correct? Thank you for your help. May I say that assistance like this is what will help get SuSE over the RedHat mountain very soon. Wayne Subject: [S.u.S.E. Linux] Re: Re: Is this a Bash 2 problem? Date: Thu, Feb 05, 1998 at 11:43:55AM +0100 In reply to:Hubert Mantel Quoting Hubert Mantel(mantel@suse.de):
Hi,
On Wed, 4 Feb 1998 wtopa@ix.netcom.com wrote:
Hubert Thank you for the reply. I appreciate your concern with the way I went about getting my prompt to work. I think I follow your reasoning except for the "pwd -P". I can't find any reference to the "-P" in regards to pwd. I may have done something correct in my .bash_profile because I do not see the same results as yu show. My running of your test yields the following.
VT5 wtopa-SuSE:~$ cp FUNNY sad cp: FUNNY: No such file or directory VT5 wtopa-SuSE:~$ echo $? 1 VT5 wtopa-SuSE:~$ unset PS1 cp FUNNY sad cp: FUNNY: No such file or directory echo $? 1
Sorry about the lack of a prompt, you understand. As I view the above results, I do not see the problem occuring that prompted your concern, or have I mis-understood you?
You have no system command in your PS1 variable. In this case it works correctly. In my example, the `pwd` did overwrite the return code from the cp command.
For the difference between `pwd` and `pwd -P` look at this example:
Mandelbrot:/home/alex/mantel > md -p a/b/c Mandelbrot:/home/alex/mantel > ln -s a/b/c d Mandelbrot:/home/alex/mantel > cd d Mandelbrot:/home/alex/mantel/a/b/c > pwd /home/alex/mantel/d Mandelbrot:/home/alex/mantel/a/b/c > pwd -P /home/alex/mantel/a/b/c Mandelbrot:/home/alex/mantel/a/b/c >
`pwd -P` shows the "real" location. We did it this way due to demand from many of our customers. After having done so, we noticed the problem with the overwritten return code and switched to using the PROMPT_COMMAND.
Wayne
Hubert
-- To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
.
-- -- Windows95 (noun): 32 bit extensions and a graphical shell for a 16 bit patch to an 8 bit operating system originally coded for a 4 bit microprocessor, written by a 2 bit company, that can't stand 1 bit of competition. -- To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
participants (1)
-
wtopa@ix.netcom.com