• southerntofu
    link
    fedilink
    arrow-up
    3
    ·
    2 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?