Tuesday, June 18, 2013

pushd & popd

If you are ever writing a shell script that has to change the directory but you want to go back to wherever the user was, use pushd & popd. Here is my example case where I wanted to write a shortcut for deploying a portlet to my portal project.
function upDeployPortlet() 
{
  pushd  ~/projects/uPortal/myuw-madison/
  ant deployPortletApp -DportletApp="$@"
  popd
}

No comments:

Post a Comment