[IPython-user] newbie: how to alias a command permanently to a disk location
Jerry McRae
qrs0xyc02@sneakemail....
Mon May 21 01:06:39 CDT 2007
As mentioned in the manual, executing a CD command using Windows does not
work, because your working directory is in memory, like all the environment
variables. If you execute a command that changes the environment (like CD or
SET), as soon as you return from the cmd.exe shell, it will be gone.
What you might want instead is the %bookmark command. You type %bookmark
mywork c:/data/projects/work/important/current/smith and then any time you
wish to change to that folder, use either of these commands: %cd mywork
-or- %pushd mywork. (note that you can use "/" instead of "\" as long as
you are running an iPython command - not a !windows command).
See the example initialization files ipythonrc-xxx.ini and/or
ipy_profile_xxx.py (in "Documents and Settings\YOURNAME\_ipython"). These
show examples of setting aliases (and many other things) so that they exist
when you first start. Also search for 'alias' on the main website at
ipython.scipy.org for a way of storing your aliases w/o editing any file.
HTH
--Jerry
On 5/20/07, Simon J. Hook simon.j.hook-at-jpl.nasa.gov |<
...> wrote:
>
> Hi,
>
> I want to alias a command. If I start ipython and type:
>
> alias mywork cd e:\windows
>
> this appears to work by then typing
>
> mywork
>
> but when I do an ls I have not moved directory?
>
> Eventually I would like to add this to a user configuration file, so if
> someone knows how to do that as well it would be much appreciated.
>
> Thanks, Simon
>
>
>
>
>
>
> _______________________________________________
> IPython-user mailing list
> IPython-user@scipy.org
> http://lists.ipython.scipy.org/mailman/listinfo/ipython-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ipython.scipy.org/pipermail/ipython-user/attachments/20070520/b7c27fb2/attachment.html
More information about the IPython-user
mailing list