What shell do you guys use? - BSD
Users browsing this thread: 21 Guest(s)
|
|||
I tried posh on Linux for a couple of days, but none of the plugins worked, they all required Windows. The problem with higher level languages on the command line is that a shell's main duty is to fork processes. Once the shell is forked, the only communication available are inter process through a pipe. All of the environment is no longer shared.
I was thinking about storing the environment in a sqlite db and sharing it across shell forks. In es: Code: ; let (i = 0) { fn hello {echo $i; i = <={%sum $i 1}}} The closure variable i is incremented after every invocation of hello, but if hello in a subprocess, then i doesn't change: Code: ; echo `{hello ; hello ; hello} The subshell fork of the backquote operator causes the variable i to be copied and manipulated in the subshell. The same happens with the env in bash when a subshell is spawned. If the environment were persistent, that might allow for fancier command line multi processing. Maybe a new subshell operator, for example: Code: # normal subshell fork copy env |
|||