bug-bash
[Top][All Lists]
Advanced

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

Re: Standard .bashrc needs a minor fix


From: Greg Wooledge
Subject: Re: Standard .bashrc needs a minor fix
Date: Fri, 7 May 2010 08:49:26 -0400
User-agent: Mutt/1.4.2.3i

On Thu, May 06, 2010 at 09:30:20AM -0500, Chuck Remes wrote:
> The standard .bashrc contains a line of code that precludes certain scripts 
> from executing. It has to do with 
> the logic for checking if the session is interactive.

There's no such thing as a "standard .bashrc", at least not from the
point of view of a bash bug mailing list.  Files like .bashrc are
supplied by the OS vendor, or created by the user.

> e.g.
> [ -z "$PS1" ] && return

That's certainly *not* how I'd write that check.  If the goal is to
protect a block of commands from running when the shell is invoked
without a terminal, then I'd prefer this:

if [ -t 1 ]; then
    # All your terminal commands go here
    stty kill ^u susp ^z intr ^c
    ...
fi

But this bug report really needs to be made against your OS, not bash.




reply via email to

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