Simple bash alias

This post is a sort of follow up to the previous one however for a different purpose. So imagine that you have to create passwords on a regular basis, for your end users or what not. Obviously you want them to be unique, and strong. In addition to the “Randpass” script that I have added to the site you can create a simple alias in your .bashrc to simplify creating these passwords.

Edit your .bashrc with your favorite text editor (vim,vi,nano,gedit etc..) and add the following line to the very end of the file:
[bash]alias pass="curl -s http://dev.linux-servers.net/index.php?id=randpass"[/bash]

Here is an example of what your .bashrc should look similar to after the changes: # .bashrc
[bash]
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# User specific aliases and functions
alias pass="curl -s http://dev.linux-servers.net/index.php?id=randpass"[/bash]

Once this is done run the command “bash -l” or close then re-open your shell. Now you should be able to run the command “pass” and it will output a password for you to use. The output should look like this:
[bash]user@localhost:~$ pass
xehiqo4tdw
user@localhost:~$[/bash]