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

2017-03-28 Thread Chet Ramey
On 3/28/17 12:43 PM, Torka Noda wrote: > Actually, shouldn't `bash -s`, without any command fed to its > stdin, exit immediately, anyway...? No. Why? It reads and executes commands from its standard input, which is in most cases, the terminal. However, `bash -s foo Plus there is > apparently no

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

2017-03-28 Thread Chet Ramey
On 3/28/17 1:13 PM, Torka Noda wrote: > Modifying positional parameters with `set --` isn't supposed to > modify the shell's behavior live, anyway. The command line is > already parsed and options already set. So Bash should always > use the original arguments specified on the command line, to > p

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

2017-03-28 Thread Torka Noda
On Mon, 27 Mar 2017 10:04:16 -0400 Daniel Mills wrote: > > 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. > They could simply be copied. M

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

2017-03-28 Thread Torka Noda
On Tue, 28 Mar 2017 10:29:57 -0400 Chet Ramey wrote: > On 3/27/17 8:32 AM, Torka Noda wrote: > > On Sat, 25 Mar 2017 15:33:47 -0400 > > Chet Ramey wrote: > >>> > >>> Is it normal for Bash positional parameters not to be > >>> available from ~/.bashrc during initialization? > >> > >> Yes. Ba

Re: The lastpipe shell option even with job control?

2017-03-28 Thread Dr. Werner Fink
On Tue, Mar 28, 2017 at 10:17:54AM -0400, Chet Ramey wrote: > On 3/27/17 9:44 AM, Dr. Werner Fink wrote: > > Hi, > > > > I'd like to ask if there is crucial reason, beside the correct foreground > > process group, not to allow the lastpipe shell option for an interactive > > bash? Maybe something

Re: fc keeps set -v for process substitution

2017-03-28 Thread Chet Ramey
On 3/27/17 2:16 PM, Grisha Levit wrote: > When the command to be fixed-up has a process substitution, `fc' prints > out not only the fixed-up command (as expected) but also any commands that > are part of a process substitution in the command: > >$ FCEDIT=':' # doesn't really matter >$ :

Re: Parameter operator P should probably strip \[ and \] characters

2017-03-28 Thread Chet Ramey
On 3/27/17 7:49 AM, Torka Noda wrote: >> In general, you want the \[ and \] sequences expanded in all >> cases where the result will eventually be fed to readline, >> and stripped when it is not. It's not feasible for bash to >> figure that out for itself, so you have to tell it. Since >> those e

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

2017-03-28 Thread Chet Ramey
On 3/27/17 8:32 AM, Torka Noda wrote: > On Sat, 25 Mar 2017 15:33:47 -0400 > Chet Ramey wrote: >>> >>> Is it normal for Bash positional parameters not to be >>> available from ~/.bashrc during initialization? >> >> Yes. Bash has always worked like this. The startup files are >> read before the

Re: The lastpipe shell option even with job control?

2017-03-28 Thread Chet Ramey
On 3/27/17 9:44 AM, Dr. Werner Fink wrote: > Hi, > > I'd like to ask if there is crucial reason, beside the correct foreground > process group, not to allow the lastpipe shell option for an interactive > bash? Maybe something like in the attachment could be an option? Yes, there is. Once you deci