[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A feature request
From: |
Pádraig Brady |
Subject: |
Re: A feature request |
Date: |
Tue, 23 Mar 2010 15:43:03 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 |
On 23/03/10 15:43, Ben Walton wrote:
> Excerpts from Claes Lindvall's message of Tue Mar 23 11:31:43 -0400 2010:
>
>> # mkdir -c <dir> (-c changedir)
>> or a new command
>> # mkcdir <dir>
>
> This would (imho) be better handled as a shell function. A (bash)
> example (needs more error/sanity checking):
>
> function mkcdir() { mkdir "$1"; cd "$1"; }
It has to be a function of the shell,
since a command can can't the current dir
of it's parent (the shell).
I do this so often that I use a shorter name in my .bashrc:
md () { mkdir -p "$1" && cd "$1"; }
cheers,
Pádraig.