im building my one commands of bash but im have fond a command it is impossible to replicate
the command bash cd change directory only change directory of current program not parents directory can im use c to change the parent directory just try "curdir" and system variable eviron "pwd" but nothing change the parent command line? thanks :)
https://github.com/honeydatax/fbc-bash
change directory command solved
-
- Posts: 26
- Joined: Jul 11, 2021 11:55
change directory command solved
Last edited by honeydatax on Aug 29, 2021 7:52, edited 1 time in total.
Re: change directory command
In Linux, or any posix system, no process can change the current working directory of its parent. It can only change it for itself and subsequently spawned processes. That's why cd is built into bash and is not a separate binary, unlike cat, ls, less, grep, etc.
I discovered that FreeBSD ships with a binary called /usr/bin/cd, and it works like the build-in cd, but it's for a different purpose and has no effect on the shell's current working directory when you run it, for the same reason I gave above.
I discovered that FreeBSD ships with a binary called /usr/bin/cd, and it works like the build-in cd, but it's for a different purpose and has no effect on the shell's current working directory when you run it, for the same reason I gave above.
-
- Posts: 26
- Joined: Jul 11, 2021 11:55
Re: change directory command
Thanks im discover other command than canot change the parent read , canot change eviron vars :)
-
- Posts: 26
- Joined: Jul 11, 2021 11:55
Re: change directory command
https://github.com/honeydatax/fbc-bash/ ... imeout.bas
Im building a timeout.bas
Program im want to put on console "./timeout 100 sleep 2" to stop program from go on from this time
But the process shell keep on runing wat is wrong :) ?
Thanks
Im building a timeout.bas
Program im want to put on console "./timeout 100 sleep 2" to stop program from go on from this time
But the process shell keep on runing wat is wrong :) ?
Thanks
Re: change directory command
That's correct. You cannot change the environment of the parent process. That's also why manipulating environment variables is built into the shell and not done using external binaries.honeydatax wrote:Thanks im discover other command than canot change the parent read , canot change eviron vars :)
-
- Posts: 26
- Joined: Jul 11, 2021 11:55
Re: change directory command
Im have other bug on my code; in my command line mini shellter ; if im call a process by mousepad & ; the process gets over the console input ; wat im can do to get input console wat im do wrong?
Thanks all been help
https://github.com/honeydatax/fbc-bash/ ... n/bash.bas
Thanks all been help
https://github.com/honeydatax/fbc-bash/ ... n/bash.bas