News for hackers. Stuff that matters.
Re:Ask HN: Can I see your scripts? by junon on Monday August 15, 2022 @08:41AM (#32468922)

    function ccd { mkdir -p "$1" && cd "$1" }
Biggest timesaving script I've ever included in my arsenal.
Re:Ask HN: Can I see your scripts? by cmg on Monday August 15, 2022 @09:40AM (#32469517)
I have this one aliased to mkcd, but yours saves an extra character. I like it!
Re:Ask HN: Can I see your scripts? by valbaca on Thursday August 18, 2022 @12:14AM (#32505195)
add in exec functionality and you've got xkcd!
Re:Ask HN: Can I see your scripts? by anjanb on Monday August 15, 2022 @10:59AM (#32470505)
I call it "mcd"(for make and cd) on my windows cmd and bash shells
Re:Ask HN: Can I see your scripts? by zeppelin101 on Monday August 15, 2022 @10:07AM (#32469858)
Zsh has the "take" command which accomplishes this.
Re:Ask HN: Can I see your scripts? by runjake on Monday August 15, 2022 @10:58AM (#32470502)
Correction: Zsh does not have the take command. The Oh My Zsh add-on has the take command.

(Lots of us don't use OMZ)

Re:Ask HN: Can I see your scripts? by zeppelin101 on Monday August 15, 2022 @06:06PM (#32476076)
Very interesting - didn't know that. I always install OMZ after zsh.
Re:Ask HN: Can I see your scripts? by amid11 on Monday August 15, 2022 @01:08PM (#32472363)
Didn't know that! thank you
Re:Ask HN: Can I see your scripts? by aslushnikov on Monday August 15, 2022 @10:42AM (#32470304)
I use `mkdir -p DIRECTORY_NAME && cd $_` in bash which is not as concise but still DRY.
Re:Ask HN: Can I see your scripts? by junon on Monday August 15, 2022 @11:03AM (#32470571)
This is the sort of DRY that is more dogmatic than helpful, IMO.
Re:Ask HN: Can I see your scripts? by bradwood on Monday August 15, 2022 @02:35PM (#32473516)
Quite.

DRY is a good guideline but a rubbish rule.