Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Also, I'd like to offer some words of caution to those who want lots of "external" (i.e. not bash-native) data in their PS1 string. Running outside programs can be expensive. For personal workstation use, things like the above are great. However, if you administer a remote (perhaps resource-constrained) server and you find yourself trying to rescue it from swap-death (or a partially busted HDD), you may not want to be 1) forking subprocesses, 2) allocating file descriptors, and 3) doing disk IO every time you hit the enter key. Build responsible prompt strings everyone.


If you're actually trying to rescue a server, you can just do "export PS1='#'" once to disable it for the current session.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: