git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] __git_ps1: Don't kill shell if user types `set -e`

From
Tom Hale <tom@hale.ee>
Date
May 4, 2017, 09:35 UTC
Message-ID
<60ea6f0e-aa27-9a2c-54fd-9c14db9f028c@hale.ee>
In-Reply-To
<CACBZZX6XdwND2-7cY0zp8+K_uh60tn-i_r9V7HAe2X-a-RJeQA@mail.gmail.com>
On 04/05/17 16:16, Ævar Arnfjörð Bjarmason wrote:
Show 9 quoted lines
> What's the real use-case here? If you do "set -e" in your shell you
> also get e.g.:
> 
>     $ ls -l blah
>     ls: cannot access blah: No such file or directory
>     === Command terminated with exit status 2 (Thu May  4 11:16:03 2017) ===
> 
> I.e. any little failure will terminate your shell, are you actually
> running a shell like this? For what purpose?

If I want to copy and paste a list of commands and have the execution stop at a failure, I type "bash" then "set -e", then paste the commands.

It saves me creating a script file and then removing it later.
-- 
Tom Hale
Previous: Ævar Arnfjörð Bjarmason
Message 5 of 5 in “__git_ps1: Don't kill shell if user types `set -e`”
  1. __git_ps1: Don't kill shell if user types `set -e`Tom "Ravi" Hale, Apr 16, 2017
  2. Junio C HamanoApr 17, 2017
  3. Tom HaleMay 4, 2017
  4. Ævar Arnfjörð BjarmasonMay 4, 2017
  5. Tom HaleMay 4, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.