Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Silencing EC2 errors on Snow Leopard. Also see
To stop being annoyed by Java errors when using the EC2 API tools
on Snow Leopard, apply the following patch:
--- /ports/bin/ec2-cmd 2009-10-03 01:44:04.000000000 +0100
+++ /tmp/ec2-cmd 2009-10-03 01:44:54.000000000 +0100
@@ -58,4 +58,13 @@
-"$JAVA_HOME/bin/java" $EC2_JVM_ARGS $cygprop -classpath "$CP"$CMD "$@"
+# to filter out the "deprecated" warnings introduced by Snow Leopard...
+exec 3>&1 # ... redirect fd3 to stdout
+exec 4>&2 # ... redirect fd4 to stderr
+# ... execute the java, sending stderr to stdout (so it gets grepped),
+# but stdout goes to fd3 (the preserved real stdout)
+# and the grepped output goes to fd4 (the preserved stderr)
+"$JAVA_HOME/bin/java" $EC2_JVM_ARGS $cygprop -classpath "$CP"$CMD "$@" \
+ 2>&1 >&3 | grep -v '^\[Deprecated\] Xalan' >&4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.