What shell do you guys use? - BSD

Users browsing this thread: 1 Guest(s)
injinj
Registered
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}}}
; hello ; hello ; hello
0 1 2

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}                                        
3 4 5
; echo `{hello ; hello ; hello}                                        
3 4 5

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
$ echo $(i=hello ; echo $i)
hello
# shared subshell fork share env
$ echo %(i=hello ; echo $i) ; echo $i
hello
hello


Messages In This Thread
RE: What shell do you guys use? - by smlb - 30-07-2014, 12:10 PM
RE: What shell do you guys use? - by eye - 30-07-2014, 12:12 PM
RE: What shell do you guys use? - by kirby - 30-07-2014, 07:22 PM
RE: What shell do you guys use? - by dcli - 30-07-2014, 08:42 PM
RE: What shell do you guys use? - by casscode - 31-07-2014, 06:40 AM
RE: What shell do you guys use? - by shtols - 31-07-2014, 11:08 AM
RE: What shell do you guys use? - by dcli - 31-07-2014, 01:16 PM
RE: What shell do you guys use? - by z3bra - 31-07-2014, 07:16 PM
RE: What shell do you guys use? - by jobss - 10-10-2014, 08:41 AM
RE: What shell do you guys use? - by xero - 10-10-2014, 10:57 AM
RE: What shell do you guys use? - by nopc0de - 11-10-2014, 01:58 PM
RE: What shell do you guys use? - by b4dtR1p - 12-10-2014, 09:15 AM
RE: What shell do you guys use? - by projektile - 13-10-2014, 03:13 AM
RE: What shell do you guys use? - by dcat - 13-10-2014, 09:40 AM
RE: What shell do you guys use? - by venam - 13-10-2014, 10:29 AM
RE: What shell do you guys use? - by z3bra - 13-10-2014, 01:01 PM
RE: What shell do you guys use? - by nrmc.dubz - 13-10-2014, 08:41 PM
RE: What shell do you guys use? - by delucks - 17-10-2014, 01:10 PM
RE: What shell do you guys use? - by sodaphish - 29-10-2014, 11:14 PM
RE: What shell do you guys use? - by exp0sure - 31-10-2014, 04:27 PM
RE: What shell do you guys use? - by rwzy - 07-11-2014, 01:41 AM
RE: What shell do you guys use? - by kaludis - 21-01-2015, 08:05 PM
RE: What shell do you guys use? - by cadav3rous - 23-04-2017, 02:48 AM
RE: What shell do you guys use? - by Mafia - 23-04-2017, 04:06 AM
RE: What shell do you guys use? - by rocx - 23-04-2017, 11:33 AM
RE: What shell do you guys use? - by Tmplt - 23-04-2017, 12:11 PM
RE: What shell do you guys use? - by jkl - 23-04-2017, 01:52 PM
RE: What shell do you guys use? - by robotchaos - 23-04-2017, 05:49 PM
RE: What shell do you guys use? - by r4ndom - 24-04-2017, 06:22 AM
RE: What shell do you guys use? - by evbo - 24-04-2017, 12:24 PM
RE: What shell do you guys use? - by jvarg - 24-04-2017, 01:51 PM
RE: What shell do you guys use? - by robotchaos - 24-04-2017, 02:33 PM
RE: What shell do you guys use? - by jvarg - 25-04-2017, 04:00 AM
RE: What shell do you guys use? - by r4ndom - 25-04-2017, 05:54 AM
RE: What shell do you guys use? - by z3bra - 25-04-2017, 06:11 AM
RE: What shell do you guys use? - by venam - 25-04-2017, 06:25 AM
RE: What shell do you guys use? - by robotchaos - 25-04-2017, 12:59 PM
RE: What shell do you guys use? - by rocx - 25-04-2017, 03:27 PM
RE: What shell do you guys use? - by robotchaos - 25-04-2017, 03:34 PM
RE: What shell do you guys use? - by dragomir - 25-04-2017, 05:49 PM
RE: What shell do you guys use? - by drkhsh - 28-04-2017, 07:38 PM
RE: What shell do you guys use? - by jkl - 02-06-2020, 09:37 AM
RE: What shell do you guys use? - by z3bra - 02-06-2020, 10:06 AM
RE: What shell do you guys use? - by jkl - 02-06-2020, 10:22 AM
RE: What shell do you guys use? - by twee - 02-06-2020, 06:57 PM
RE: What shell do you guys use? - by jkl - 03-06-2020, 01:44 AM
RE: What shell do you guys use? - by twee - 03-06-2020, 06:47 AM
RE: What shell do you guys use? - by jkl - 03-06-2020, 06:51 AM
RE: What shell do you guys use? - by wolf - 06-06-2020, 10:38 AM
RE: What shell do you guys use? - by jkl - 06-06-2020, 10:48 AM
RE: What shell do you guys use? - by ckester - 06-06-2020, 12:31 PM
RE: What shell do you guys use? - by wolf - 06-06-2020, 01:23 PM
RE: What shell do you guys use? - by jkl - 06-06-2020, 04:01 PM
RE: What shell do you guys use? - by twee - 06-06-2020, 05:15 PM
RE: What shell do you guys use? - by banna - 11-06-2020, 01:24 AM
RE: What shell do you guys use? - by phillbush - 14-06-2020, 09:54 AM
RE: What shell do you guys use? - by wolf - 18-06-2020, 03:08 PM
RE: What shell do you guys use? - by wolf - 18-06-2020, 03:10 PM
RE: What shell do you guys use? - by jkl - 18-06-2020, 03:13 PM
RE: What shell do you guys use? - by zge - 18-06-2020, 04:15 PM
RE: What shell do you guys use? - by wolf - 18-06-2020, 04:45 PM
RE: What shell do you guys use? - by phillbush - 21-06-2020, 12:21 PM
RE: What shell do you guys use? - by eadwardus - 05-07-2020, 03:08 PM
RE: What shell do you guys use? - by zge - 08-07-2020, 08:16 AM
RE: What shell do you guys use? - by phillbush - 08-07-2020, 09:14 PM
RE: What shell do you guys use? - by jkl - 09-07-2020, 01:50 AM
RE: What shell do you guys use? - by jkl - 01-10-2020, 05:52 AM
RE: What shell do you guys use? - by injinj - 01-10-2020, 07:19 AM
RE: What shell do you guys use? - by jkl - 01-10-2020, 08:44 AM
RE: What shell do you guys use? - by injinj - 01-10-2020, 05:48 PM
RE: What shell do you guys use? - by pyratebeard - 02-10-2020, 06:11 AM
RE: What shell do you guys use? - by jkl - 02-10-2020, 06:27 AM
RE: What shell do you guys use? - by injinj - 02-10-2020, 06:54 AM
RE: What shell do you guys use? - by venam - 02-10-2020, 06:56 AM
RE: What shell do you guys use? - by injinj - 02-10-2020, 12:46 PM
RE: What shell do you guys use? - by ols - 15-11-2020, 04:30 PM
RE: What shell do you guys use? - by jkl - 15-11-2020, 05:47 PM
RE: What shell do you guys use? - by ols - 15-11-2020, 06:20 PM
RE: What shell do you guys use? - by mattrose - 15-11-2020, 09:40 PM