[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GNU Parallel Bug Reports User .rc files interacting with parallel's
From: |
Ole Tange |
Subject: |
Re: GNU Parallel Bug Reports User .rc files interacting with parallel's sub shells |
Date: |
Wed, 6 Aug 2014 03:09:17 +0200 |
On Tue, Aug 5, 2014 at 6:49 PM, Achim Gratz <Stromeko@nexgo.de> wrote:
> Ole Tange writes:
>
>> In the next release $SHELL is ignored if GNU Parallel can figure out
>> which shell it is started from, so if started from tcsh, 'tcsh -c'
>> will be used to start new commands.
>
> I humbly suggest you don't do that or at least make it optional. It
> would make using a fancy interactive shell but running commands with
> something much more lightweight, for instance via
>
> SHELL=/bin/dash ENV=.shinit parallel …
>
> needlessly cumbersome.
The reason is for people that make scripts for others to run. E.g:
#!/usr/bin/tcsh
parallel 'setenv FOO bar; echo $FOO {}' ::: foo
This example uses 'setenv' which does not exist in bash.
If your login $SHELL is bash, then running that script will fail,
because GNU Parallel 20140722 will use $SHELL. The script coder's
login $SHELL is probably tcsh, so the script will work for him. This
goes against principle of least astonishment: We expect the same
script to behave the same way - no matter which login $SHELL we call
it from.
This also shows you how to force GNU Parallel to use /bin/dash: Either
make a script (starting with #!/bin/dash) or use:
dash -c 'parallel ....'
/Ole