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


Click here to return to the 'Free scripts to improve UNIX/Finder interaction' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Free scripts to improve UNIX/Finder interaction
Authored by: lee1 on Sep 22, '03 12:30:53PM
I've been using the bash shell for so long that I'm not sure about my csh syntax, but I think this should work: First, put the new commands someplace conventional in your path, like /usr/local/bin. I think in csh type shells (such as tcsh) you need to type rehash now. Now you can just type the commands with no path. The alias you can define this way: alias cdf "cd `posd`" where those are backticks around the posd. That should be one way to do it.

[ Reply to This | # ]
Free scripts to improve UNIX/Finder interaction
Authored by: sreeves on Sep 22, '03 02:54:18PM

Backticks alone will not work because they will be evaluated when the alias is defined, not in the current context of the shell. You can see this by looking at the output from alias cdf. It will say "cd somedirectory".

You need to use the eval command, like this:

alias cdf 'cd "`eval posd`"'



[ Reply to This | # ]
Free scripts to improve UNIX/Finder interaction
Authored by: lee1 on Sep 23, '03 09:04:54AM

Right- I should have used single quotes, which does work (I just tested it in csh):

alias cdf 'cd `posd`'



[ Reply to This | # ]