Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coding with VIM



On Friday, January 30, 2004, at 11:17 AM, Markus Hitter wrote:

Am 30.01.2004 um 18:22 schrieb Robert Denton:

I have some bash questions for you all:
[snip]
However, I cannot discover where to set the initial working directory, which is /Users/<username>.

Try a

	cd /path/to/wherever/i/want

in your bashrc or .bashrc

This won't work if you are executing your 'rc' file as a script that terminates. The 'cd' only has effect for the process where it is executed (and subprocesses).


The usual way to handle this is to treat the script as input commands; for example, the following shows the difference:

$ pwd
/tmp
$ cat foo
cd ..
$ sh foo
$ pwd
/tmp
$ . foo
$ pwd
/
$

Whether this will work at startup/login depends entirely on your shell and the other startup scripts invoked. You could try to force it by ending your startup script with the 'cd' command, followed by 'exec /bin/bash'. If you do that, of course, you have to be wary of recursion :-}.

Regards,

Justin

--
Justin C. Walker, Curmudgeon-At-Large  *
Institute for General Semantics        |    Men are from Earth.
                                       |    Women are from Earth.
                                       |       Deal with it.
*--------------------------------------*-------------------------------*
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Coding with VIM (From: Markus Hitter <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.