TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Halloween Bash Profile Generator

79 点作者 langer超过 12 年前

12 条评论

Tyr42超过 12 年前
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_超过 12 年前
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 未加载
levesque超过 12 年前
Where is the @ character?? How am I going to make the classic prompt?<p><pre><code> user@comp:Folder$</code></pre>
评论 #4724433 未加载
mcgain超过 12 年前
Brilliant idea. Well done! Change the name because this will be useful throughout the full year.
rexf超过 12 年前
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 未加载
Draiken超过 12 年前
Very nice! Not sure why it's halloween tho, should be named something else :)
评论 #4724080 未加载
Symmetry超过 12 年前
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_masano超过 12 年前
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!
asdfprou超过 12 年前
At first I wondered how you managed to extract my username and then I realized it was hardcoded when I looked through the code.
swah超过 12 年前
Great impleentation, but its odd that there a limited number of elements you might want many, like spaces.
agumonkey超过 12 年前
As ugly as awesome ;)
chyld超过 12 年前
Congrats Avi. Your students are killing it.