 |
 |
Anyone to implement a mkcd command?
|
 |
|
 |
|
Senior User
Join Date: Mar 2001
Location: The Netherlands
Status:
Offline
|
|
I "surf" the terminal sometimes (in fact more and more) and a mkcd command would come in handy (mkdir + cd).
I did a google search, found a solution but it left me confused. Anyone capable to implement this? Thx.
|
|
I'm-a trying to wonder, wonder, wonder why you, wonder, wonder why you act so.
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Apr 2001
Status:
Offline
|
|
well I'm new to this too but i just made and tested an alias 30 seconds ago and it worked fine.
Like this in tsch shell:
alias mkcd 'set thepath = \!*; mkdir $thepath; cd $thepath'
now i can just do
mkcd /user/example/path/with/dir/name
and it makes and moves to that dir but I'm sure there is a better way 
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2001
Status:
Offline
|
|
If you make it mkdir -p it'll create all the non-existing folders from your example too
-
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Apr 2001
Status:
Offline
|
|
lol I was gonna add that and in fact I had -p in there but deleted it at the last second because
I feel it should not be hard coded in since it is an option after all 
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Mar 2001
Location: The Netherlands
Status:
Offline
|
|
Works, terrific! Thanks a lot!
|
|
I'm-a trying to wonder, wonder, wonder why you, wonder, wonder why you act so.
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Dec 2002
Location: someplace
Status:
Offline
|
|
Bourne-shell style alias:
alias mkcd='mkdir -p $1 && cd $1'
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |