Skip to content

Instantly share code, notes, and snippets.

@klebervirgilio
Created February 8, 2013 09:43
Show Gist options
  • Save klebervirgilio/4737739 to your computer and use it in GitHub Desktop.
Save klebervirgilio/4737739 to your computer and use it in GitHub Desktop.
function add_alias {
echo "alias $1=\"$2\"" >> ~/.aliases
echo 'Reloading...'
sz
}
function show_my_aliases {
echo $my_aliases | sort | grep -e "^$" -v
}
export my_aliases=''
for file in ~/.aliases ~/.aliases1 ... ./aliasesN
do;
if [ -f $file ]; then
source $file
local buff=''
while read line
do;
buff=$buff"\n$(echo $line | replace '=' ': ')"
done < <(replace 'alias ' '' < $file)
export my_aliases=$my_aliases$buff
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment