Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Eduardo =?iso-8859-1?Q?A=2E_Bustamante_L=F3pez?= Newsgroups: gnu.bash.bug Subject: Re: Auto-update program cache feature Date: Wed, 3 Oct 2018 18:33:28 -0700 Lines: 58 Approved: bug-bash@gnu.org Message-ID: References: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1538617052 28434 208.118.235.17 (4 Oct 2018 01:37:32 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org To: Jeffrey Walton Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=YhRDa06iWc9ivD6HJXZy+7hDeYKTjVgo/MvJvb8G24o=; b=p6bjsufObocK0XFNGhjTQ+EDcBYju+Nj5oOlALG8A4CAQ/u0pU8XTLDBMysH9AjIDT U+BFKTvsZ94KabVG/GpO4GWKWwwnmKZirO4UpmhV+vZV/1WlafiUjH2smTYO8WSeqTYQ olS/ZAsDHjSFX4BD1epDyxACRB4jZgl9rCzD1v3yu66fjy7F88/yCk/hDLtOwxXBUpGm dbcb+Jm7BaViW62zpMJqVVj9+WVkFUgz8onM0T9pu2xzTHfCrxnd3VntjED8SSxRvTKq kRsQ7/ZsPnttFgeqMUIw1H96Ph+ootF5CUUSP17EDSaJc8lNHhPNGbuK5exY5xDuSvgh 9uDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=YhRDa06iWc9ivD6HJXZy+7hDeYKTjVgo/MvJvb8G24o=; b=Ero1Do5oUkPK0sZDHGp6WGmBgOxQn/DBVKhT6QAGVUQ0wUIDh/TvA2PZMk6WOd/7xl +5H4kQECE1wNnZ/jnRBG8dS2qxRkZIj1EB5ETbjk5HcOwWcG9k0QPJ3LfAkeMBKV0hKW zGibyJ2GgcTRhciuoLAroiWgJuOyY09VR1Fz4cZDpG3NWLibHpDSNKSUgbci6VRnEOK2 h4kkeiOvKRmf58OJucEkeb5YwG0QK8gf56acjm0PUCS6jKCttJCyyBxPy2zQXPDLWLqq /qKAOa+M3xBevDGaqomI6p0xWJOT3aoxK6wL77lQQeSxBYXOkhpbubMnRtyPU5fVxjbd WwWA== X-Gm-Message-State: ABuFfoj8vuSuDrRNSZnV7r5Cx5MqMMyUkhPnf9Ji/QI0IDksLz0cJgWd rmLpUGTAJzgF/aI5s6zwJm0= X-Google-Smtp-Source: ACcGV61WZqrPvXIQ2k9yiX0rm7oEBaKS58mKavlLoQz9YrAGgEh40YwzHd5JMRHbb4Xt3DXnAIg6Dw== X-Received: by 2002:a17:902:b198:: with SMTP id s24-v6mr4052768plr.70.1538616810932; Wed, 03 Oct 2018 18:33:30 -0700 (PDT) Mail-Followup-To: Jeffrey Walton , bug-bash@gnu.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::62e X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:14684 On Wed, Oct 03, 2018 at 04:45:44PM -0400, Jeffrey Walton wrote: > Hi Everyone, > > I noticed a fair number of new Linux users have trouble with stale > program caches. Users install a package from a package manager or > sources and then are confused when the new package is not used. They > do not realize they need to run 'bash -r'; and most don't know where > to begin searching. You mean `hash -r' ? > (...) > so monitoring of common commands seems like a sensible way to > implement the feature. > A single terminal can monitor for a regex that looks for 'make > install' and perhaps other common installation commands. Multiple > terminals seems like a trickier case, and could use a scheme where the > source terminal broadcasts an 'update cache' message to other open > terminals. A shell is not a terminal. A terminal is a hardware (or emulated) device that provides input/output capabilities. Nowadays most terminals are emulated (gnome-terminal, xterm, urxvt, ...), but there are still physical terminals in use. It seems quite complicated to have all terminal emulators and physical terminals introduce this functionality. And even if you manage to do that... how would that work? Terminals are only aware of the input typed by the user, and the output provided by the programs that run attached to that terminal device... that excludes a bunch of cases like: * Storing the command in a variable and then executing from the contents of that variable * Running a script that installs said binaries in a silent way ... Now, let's pretend you intention was to say that this logic should run in the /SHELL/, not the terminal. A shell only knows about the input provided by the user (through the terminal), for that specific process. So we still run into similar problems: * Binary is installed through a generic script Also, consider that bash runs in a multitude of platforms, each using their own package manager... it'd be a massive effort to gather all the possibilities into a table of patterns that you test user input against... and even if you do it, there are new platforms being introduced all the time, which means you'll have to update the table all the time to capture the new cases... that seems like a lot of work. If you don't care about performance, why don't you just run `hash -r' through PROMPT_COMMAND? That seems simple enough?