• @roastpotatothief
    link
    42 years ago

    I think an alias could do that. Another good one is cd then ls.

    • @remram
      link
      12 years ago

      An alias only runs a single command

  • @southerntofu
    link
    32 years ago

    Nice short helper!

    Why would you eval cd "\"\$$#\"" ??? So you’re passing all arguments to mkdir potentially making several folders (mkcd test1/foo1 test2/foo2), then moving into the last provided argument ($# is 1 when there is one argument and $1 is the argument) via some exec magic. To be fair it does look safe (but execs always look safe :D) but why not move into the first provided argument instead (&& cp "$1") and avoid that dance entirely?

  • @lenathaw
    link
    32 years ago

    I have a little function for that

    mkdirpushd () {
            mkdir -p ${1}
            pushd ${1}
    }