Skip to content

Commit

Permalink
Added pd function to pushd/popd based on args
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Fries committed Apr 8, 2015
1 parent c1af836 commit e74e370
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 0 additions & 3 deletions bash_aliases
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ alias lc='ls -Cg'
alias a=alias
alias h=history
alias hist=history
alias pd=pushd
alias push=pushd
alias pop=popd
alias md=mkdir
alias rd=rmdir
alias cls=clear
Expand Down
10 changes: 10 additions & 0 deletions bash_functions
Original file line number Diff line number Diff line change
Expand Up @@ -347,3 +347,13 @@ mvfileset() {
mv -v ${infile} ${outfile}
done
}

# pushd if there's nothing on the stack or there's an arg
# popd otherwise
pd() {
if [ "$#" -ne 1 ]; then
popd
else
pushd $1
fi
}

0 comments on commit e74e370

Please sign in to comment.