Friday, October 17, 2008

Variable manipulation with bash

Hi, this is the first post on this new blog, and I hope I'll be able to give you good tips.

Today it's about the '${VARIABLE}' notation in bash, we will explore some of its possibilities. Mostly those that you will reuse oftenly:
  • basename:
    ${YOURPATH##*/}
  • basedir:
    ${YOURPATH%/*}