DEV Community

Discussion on: The case against aliases

Collapse
 
moopet profile image
Ben Sinclair

I have a few aliases and one- or two-line scripts that I use for repetitive tasks every day, but the way I most often work is to group them together in one line, for instance to pull my config files, I run:

(cd ~/.dotfiles && git checkout master && git pull origin master && ./install.sh)

since it's in a subshell (the parentheses) it doesn't leave me in a different directory when it's finished and since it uses && throughout it doesn't do anything unless the previous command succeeded. I call this up by doing <ctrl-r>dotf<cr> and rely on it being in my shell history rather than making it an alias.