Just a minor issue. I'm writing a simple bash script that starts and stops Jetty. When I execute it, the script immediately puts my cursor back on the bash prompt. However, as Jetty starts up and writes its initialization output back to stdout, it leaves the cursor on a line of its own (without a prompt) until I enter a command or hit enter. Nitpicking, I know, but I figure there's an easy way to avoid this that I'm missing.

Here's the script:

#!/bin/bash
cd /opt/jetty/jetty-distribution-7.4.5.v20110725/
if [ "$1" = "-stop" ]
then
    java -DSTOP.PORT=8079 -DSTOP.KEY=something -jar start.jar --stop
else
    java -DSTOP.PORT=8079 -DSTOP.KEY=something -jar start.jar &amp;
fi


Here's the output:

[user@machine ~]# jetty
[user@machine ~]# 2011-08-11 14:47:34.818:INFO::jetty-7.4.5.v20110725
2011-08-11 14:47:34.866:INFO::Deployment monitor /opt/jetty/jetty-distribution-7.4.5.v20110725/webapps at interval 1
2011-08-11 14:47:34.878:INFO::Deployment monitor /opt/jetty/jetty-distribution-7.4.5.v20110725/contexts at interval 1
2011-08-11 14:47:34.883:INFO::Deployable added: /opt/jetty/jetty-distribution-7.4.5.v20110725/contexts/javadoc.xml
2011-08-11 14:47:34.934:INFO::started o.e.j.s.h.ContextHandler{/javadoc,file:/opt/jetty/jetty-distribution-7.4.5.v20110725/javadoc}
2011-08-11 14:47:34.935:INFO::Deployable added: /opt/jetty/jetty-distribution-7.4.5.v20110725/contexts/test.xml
2011-08-11 14:47:35.011:INFO::Extract jar:file:/opt/jetty/jetty-distribution-7.4.5.v20110725/webapps/test.war!/ to /tmp/jetty-0.0.0.0-8080-test.war-_-any-/webapp
2011-08-11 14:47:35.645:INFO::started o.e.j.w.WebAppContext{/,file:/tmp/jetty-0.0.0.0-8080-test.war-_-any-/webapp/},/opt/jetty/jetty-distribution-7.4.5.v20110725/webapps/test.war
2011-08-11 14:47:36.127:INFO:org.eclipse.jetty.servlets.TransparentProxy:TransparentProxy @ /javadoc to http://download.eclipse.org/jetty/stable-7/apidocs
2011-08-11 14:47:36.199:INFO::Started SelectChannelConnector@0.0.0.0:8080 STARTING


And the cursor ends up on a blank new line just below. Is there a way to prevent this? I'm pretty new to bash scripting, is there something I should be doing that I'm not?


Question: Voltage ratings of capacitors: ceramic vs electrolytic
Answer: You should actually not be comparing ceramics to electrolytics in terms of lifespan at all, they are actually intended for totally different purposes. Most beginners (I did untill recently) think they are just higher values, but they are as different as inductors are to resistors. Mainly because electrolytic values are more approximate, and their value much more temperature dependant than ceramic, polycarbonates or tantalum. Note: Tantalum are very voltage sensitive.

You answer is that I would also use a 50V cap for a 20V supply, in fact if you glance at the charge curve for electrolytics you will notice that they work better (more farads) at about 1/3 of their rating anyway. As for being for different purpose, you will get heating in an electrolytic if you allow it to completely charge and discharge on a cycle, for instance using a 220uF to service a 10 amp load on a rectifier will tax the cap and cause heating in the leads, and as the other answers alread indicate, heating equals less farads.

I'm just an amateur, so no clever math, sorry.