I have tried the second one, the script it self works very well. Thank you very much.
But the problem is, it works only when I log on or su - to that user. The perl file /home/apoap003/test contains the code provided by ToolKit, and in the /home/apoap003/.profile I have PS1 defined as below...
Thank you very much for Jim and ToolKit. It is really nice to get responses so quickly. All of your responses are really helpfule. I will try both ways and let you know if it works.
Thank you very much again.
I need to modify the .profile of an account, and I have this line in the .profile:
PS1=`hostname`':$LOGNAME:$PWD>'
But my boss want me to get only the last 3 levels of the subdirectory if `pwd` returns a long path. For example, if `pwd` returns...
Thank you for your reply. Actually I was thinking about the method you suggest, but I am so stupid that I don't know how to get the number of '/' from `pwd`. It should be only several lines of code, but I could not make it work. Could you provide me with a sample? Many thanks.
I need to modify the .profile of an account, and I have this line in the .profile:
PS1=`hostname`':$LOGNAME:$PWD>'
But my boss want me to get only the last 3 levels of the subdirectory if `pwd` returns a long path. For example, if `pwd` returns...
I need to modify the .profile of an account, and I have this line in the .profile:
PS1=`hostname`':$LOGNAME:$PWD>'
But my boss want me to get only the last 3 levels of the subdirectory if `pwd` returns a long path. For example, if `pwd` returns...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.