Re: I cannot use the 'cd' command in a script |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/slitaz Archives
]
Hey!
Thanks for your answer.
Do you know how i can change the current directory with a script ?
Le Fri, 15 Apr 2011 12:06:55 -0400 (EDT),
Ish Rattan <ishwar@xxxxxxxxxxxxxxxxxx> a écrit :
>
> Script is executed in a seperate shell..
>
> /ir
>
> On Fri, 15 Apr 2011, seb wrote:
>
> >
> > Hey!
> >
> > I'm on a 100% tty old (very)laptop.
> > I have to script some stuff in order to avoid boring manipulations
> > (for example to manage USB key that i always need : no internet
> > access and very small hard drive)
> >
> > I'm very happy with slitaz, i can do a lot but here, i'm stuck with
> > something i don't understand.
> >
> > When using the 'cd' command in a script it has no impact on the
> > current shell :
> >
> > i'm in /etc/
> >
> > --------------------------
> > #!/bin/sh
> > #here is an simple example
> >
> > cd /
> > exit
> > --------------------------
> >
> > after execution of this script, i'm still in /etc/
> >
> > why ?
> >
> > thinking it was a sh (busybox) problem, i installed bash and with
> > help from indigo on IRC, i linked /bin/sh to /bin/bash
> > but i got the same bad result.
> >
> > Thanks for help
> >
> >
> > ---
> > SliTaz GNU/Linux Mailing list - http://www.slitaz.org/
> >
> >
>
> ---
> SliTaz GNU/Linux Mailing list - http://www.slitaz.org/
>
>
---
SliTaz GNU/Linux Mailing list - http://www.slitaz.org/