Guest User

BashAliasesExample

a guest
Nov 16th, 2015
68
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #+----------------------------------------------------------------------------+
  2. #+ Stores the location of our .bash_aliases file to a variable which will be
  3. #+ callable as ${BashAliasesFile} - you'll see this in our functions.
  4. #+----------------------------------------------------------------------------+
  5. BashAliasesFile="/root/.bash_aliases"
  6.  
  7. #+----------------------------------------------------------------------------+
  8. #+ Usage: makedirectory directoryname
  9. #+----------------------------------------------------------------------------+
  10. alias makedirectory="mkdir"
  11.  
  12. #+----------------------------------------------------------------------------+
  13. #+ Usage: makedirectories /home/domains/yourdomain.ext/htdocs/public_html
  14. #+----------------------------------------------------------------------------+
  15. alias makedirectories="mkdir -p"
  16.  
  17.  
  18. #+----------------------------------------------------------------------------+
  19. #+ Functions
  20. #+----------------------------------------------------------------------------+
  21. aliasmod()
  22. {
  23.     #+------------------------------------------------------------------------+
  24.     #+ Calls nano to open /root/.bash_aliases
  25.     #+------------------------------------------------------------------------+
  26.     nano ${BashAliasesFile}
  27. }
  28.  
  29. aliasupdate()
  30. {
  31.     #+------------------------------------------------------------------------+
  32.     #+ Sources our /root/.bash_aliases file
  33.     #+------------------------------------------------------------------------+
  34.     source ${BashAliasesFile}
  35. }
RAW Paste Data