bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is it normal for `bash -s foo` not to make 1=foo available from ~/.b


From: Daniel Mills
Subject: Re: Is it normal for `bash -s foo` not to make 1=foo available from ~/.bashrc?
Date: Mon, 27 Mar 2017 10:04:16 -0400



On Mon, Mar 27, 2017 at 8:32 AM, Torka Noda <kanito.tasoga@gmail.com> wrote:
For any particular reason?

Why are they not all made available anyway? with an alternative
array for the arguments sent to the commands fed to Bash stdin
with "-s", so we don't have to handle all possible arguments if
we just want the non-option arguments.


There definitely are other relatively clean ways (`env` and
'--rcfile', most notably), but using `bash -s foo bar` and
handling the positional parameters from ~/.bashrc, would be the
cleanest for small per-shell customizations (although it sure is
not what '-s' is meant to be used for).


Examples of people trying stuffs related to this:

"Open gnome terminal programmatically and execute commands
after bashrc was executed":
https://superuser.com/questions/198015

"Open gnome terminal programmatically and execute commands
after bashrc was executed":
http://stackoverflow.com/questions/3896882

"Custom environment with gnome-terminal":
http://askubuntu.com/questions/600139

"Opening multiple tabs with gnome-terminal":
http://askubuntu.com/questions/277543


Because you want the positional parameters set with bash -s to take
precedence over anything set in the startup files. Otherwise anything in
.bashrc would simply override what you set with bash -s.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]