|
From: Ethan A M. <EAM...@gm...> - 2016-12-17 17:56:03
|
On Saturday, 17 December 2016 01:48:53 PM ivana richterova wrote:
> Hi all,
>
> I'd like to change shell used for system calls on linux. I quess it
> should work the same way as Unix according to manual (set SHELL
> env_var) but it doesn't.
Gnuplot uses the system() call, which always uses /bin/sh
See man (3) system:
SYNOPSIS
#include <stdlib.h>
int system(const char *command);
DESCRIPTION
The system() library function uses fork(2) to create a child process that exe‐
cutes the shell command specified in command using execl(3) as follows:
execl("/bin/sh", "sh", "-c", command, (char *) 0);
So no, it is not possible to change the shell used for a system call.
>
> On
> #Linux deimos 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt9-3 (2015-04-23)
> x86_64 GNU/Linux
> #GNU bash, version 4.3.33(1)-release (x86_64-pc-linux-gnu)
>
> I get:
> #> export SHELL=/bin/bash; gnuplot -d -e 'pr system("echo $0 $SHELL")'
> # sh /bin/bash
>
> Does anybody know how to change shell used by gnuplot on linux?
>
> thanks
>
> Iva
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> gnuplot-info mailing list
> gnu...@li...
> Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
|