Bash Linky Goodness

I have been in the process of learning to write bash scripts and also make the as efficient as possible.  I never really had the need to learn any scripting until recently so I dove in.  I thought  I would compile a nice list of some sites that have information on Bash scripting, that way if anyone else is interested they can have an easy start on getting into it.

Bash Cures Cancer – Learn the UNIX/Linux command line.
Grover Ponders – Here is some information about creating a menu system for your scripts.
Here is a nice Crash course on getting used to bash in general.
Bash Reference Manual – This has it all.
And this has the rest. (Advanced Bash-Scripting Guide)
Sample scripts can be found here, and here.

Hope some of those links come in handy.  If you have any other helpful bash scripting links please leave a comment.

SSH automatic login assistance script

A while ago I did a write up on SSH keys, anyways I was looking into it a little more today and came across this handy little script that makes it… well simple.  I didn’t write it myself, I found it over here.  Go ahead and give it a try it works like a charm.

# say: ./ hostname
# Uploads your to the specified host, wrapped for readability
if [ ! -r ${HOME}/.ssh/ ]; then
ssh-keygen -b 2048 -t rsa
# Append to the copy on the remote server
cat ~/.ssh/ | ssh ${USER}@ "cat - >> .ssh/authorized_keys"

if [ $? -eq 0 ]; then
echo "Success"