Wednesday, July 24, 2013

Work notes; bash

Bash

How to view the rails console history?

less ~/.irb_history
http://stackoverflow.com/questions/11601303/how-to-view-the-rails-console-history

I opened one of my log files from finder and it was automatically opened in textedit. I proceeded to select content using vim key sequences and ended up over-writing a section. "No problem," I thought; "I'll just close the file and not save." To my dismay, textedit didn't even prompt me and saved the file just before closing it. And with no backups, I figured I had lost it.

But wait; I seem to recall that the Rails console has history because I can up-arrow to previous commands. Where is it? How relieved I was to discover '~/.irb_history'.

Exclude items in a list in a bash script

http://moinne.com/blog/ronald/bash/exclude-items-in-a-list-in-a-bash-script

Looks interesting, but I went with a different route.

Bash Shell Loop Over Set of Files

FILES="./ws-idm/src/main/config/server.jks
./ws-ucidm/src/main/config/server.jks
./ws-ucidm-service/src/main/config/server.jks"

for f in $FILES
do
 cp /Users/davidvezzani/java-app/tomcat/conf/server.002.jks $f
done
http://www.cyberciti.biz/faq/bash-loop-over-file/

I needed to update all instances of a Java keystore I was working on.

No comments:

Post a Comment