|
From: BBands <bb...@gm...> - 2016-12-18 19:36:03
|
Could write your commands to a file and select the shell via a sha-bang?
#!/bin/bash
# Proper header for a Bash script.
# Some other possibilities
#!/bin/sh
#!/bin/bash
#!/usr/bin/perl
#!/usr/bin/tcl
#!/bin/sed -f
#!/bin/awk -f
John
On Sat, Dec 17, 2016 at 9:38 AM, Ethan A Merritt <EAM...@gm...>
wrote:
> 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
>
>
> ------------------------------------------------------------
> ------------------
> 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
>
|