Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Create a command to 'cd' to frontmost Finder window' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create a command to 'cd' to frontmost Finder window
Authored by: gidds on Oct 04, '05 01:13:29PM
There's already a way to do this: type 'cd ' at the command line, and then drag a folder onto it. (You can drag a folder from a Finder window or the desktop, or from a title bar.) It automatically adds escape characters as needed, and is also useful for commands other than 'cd'. (You can drag files as well as folders, and more than one at once.)

A dedicated script may be better choice if you're doing this specific thing a lot, but it's always good to know what built-in features are available, and for casual use it beats having to install extras, forget where they are, etc..

---
Andy/

[ Reply to This | # ]

reminders of aliases
Authored by: hayne on Oct 04, '05 02:02:29PM
I keep all my Bash aliases and functions in the file "~/.aliases.bash" which I source in my ~/.profile

And one of the things in that file is the following Bash function which I use to remind myself of what aliases (or other commented reminders) I have in that file:


# showa: to remind yourself of an alias (given some part of it)
showa () { /usr/bin/grep -i -a1 $@ ~/.aliases.bash | grep -v '^\s*$' ; }


[ Reply to This | # ]
reminders of aliases
Authored by: datawrangler on Oct 04, '05 03:45:46PM

Also, the bash shell command 'alias' will display a list of all aliases you have set



[ Reply to This | # ]
aliases vs functions
Authored by: hayne on Oct 07, '05 07:34:55AM

But the Bash command 'alias' only shows aliases (obviously!)
and many of the things in my .aliases.bash are actually Bash functions
since Bash aliases are so limited - e.g. no way to insert command-line args



[ Reply to This | # ]