TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Halloween Bash Profile Generator

79 pointsby langerover 12 years ago

12 comments

Tyr42over 12 years ago
One option that is missing that I really thing is useful is<p><pre><code> wincolour=$yellow errorcolour=$red # To provide a coloured version of $?, wrapped in (). Used in PS1 pretty_exit_code(){ LAST_COMMAND_STATUS=$? if [ $LAST_COMMAND_STATUS = 0 ]; then echo -e "$wincolour($LAST_COMMAND_STATUS)$black"; else echo -e "$errorcolour($LAST_COMMAND_STATUS)$black"; fi } </code></pre> Which just provides the exit code of the last command, but coloured differently for failure or success.
评论 #4723826 未加载
评论 #4725116 未加载
cjg_over 12 years ago
Nice!<p>A bug report, space tokens should not exhaust. Currently you can at max have 2 spaces, the one that is in the config by default and one from the available tokens.
评论 #4723780 未加载
评论 #4724830 未加载
levesqueover 12 years ago
Where is the @ character?? How am I going to make the classic prompt?<p><pre><code> user@comp:Folder$</code></pre>
评论 #4724433 未加载
mcgainover 12 years ago
Brilliant idea. Well done! Change the name because this will be useful throughout the full year.
rexfover 12 years ago
Hey everyone,<p>Thanks for checking out the bash profile generator! I'm a student at Flatiron School[1] NYC (where we have electricity in NYC, no small feat today) and this project came about when we were learning to setup our CLIs in the first week.<p>Please let me know if you have any comments/feedback on twitter: @rexfeng<p>[1] <a href="http://flatironschool.com/" rel="nofollow">http://flatironschool.com/</a>
评论 #4723805 未加载
评论 #4723862 未加载
Draikenover 12 years ago
Very nice! Not sure why it's halloween tho, should be named something else :)
评论 #4724080 未加载
Symmetryover 12 years ago
Very nice. I sort of with there was an easy way to do fish style prompt paths in bash (/home/username/bin -&#62; /h/u/bin), but that's hardly this excellent website's fault. I guess I'm just annoyed at being tied to bash due to ROS.
评论 #4724521 未加载
paupino_masanoover 12 years ago
I love this idea - especially for those that are unfamiliar with BASH yet still want to customize their command line experience. Unfortunately due to a previous HN article I now use zsh - would love to see a zsh prompt generator too!
asdfprouover 12 years ago
At first I wondered how you managed to extract my username and then I realized it was hardcoded when I looked through the code.
swahover 12 years ago
Great impleentation, but its odd that there a limited number of elements you might want many, like spaces.
agumonkeyover 12 years ago
As ugly as awesome ;)
chyldover 12 years ago
Congrats Avi. Your students are killing it.