Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #29618

Re: tip for improving your shell skills

From Eli the Bearded <*@eli.users.panix.com>
Newsgroups comp.os.linux.misc
Subject Re: tip for improving your shell skills
Date 2020-04-02 17:17 +0000
Organization Some absurd concept
Message-ID <eli$2004021317@qaz.wtf> (permalink)
References <eli$2004011957@qaz.wtf> <be3glg-uht.ln1@news.cfaj.ca>

Show all headers | View raw


In comp.os.linux.misc, Chris F.A. Johnson <newsgroups@cfaj.ca> wrote:
> On 2020-04-02, Eli the Bearded wrote:
> > By running:
> > echo "set -e" >> ~/.bash_profile
> > You can put your shell (well, at next login) into an enhanced error
> > checking mode.
>    "Enhanced" is overstating the case; it does very limited error
>    checking.

It does very effective error checking, but it's very painful for
interactive shells. 

>    Bash only includes it because POSIX requires it.

If true, that's very stupid. It is extremely useful in writing shell
scripts that do not blindly continue running after an error. It is
the belt to the suspenders of writing code that checks errors. You do
write code that checks errors, don't you?

I posted that as an April Fools suggestion. I was inspired after
sourcing a file that used "set -e" because I wanted to run a function
it defined. And then ten minutes later doing something and finding
my ssh connection suddenly closed.

Elijah
------
set the Keywords header in the original post as a hint

Back to comp.os.linux.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

tip for improving your shell skills Eli the Bearded <*@eli.users.panix.com> - 2020-04-02 00:09 +0000
  Re: tip for improving your shell skills Bit Twister <BitTwister@mouse-potato.com> - 2020-04-01 23:04 -0500
  Re: tip for improving your shell skills "Chris F.A. Johnson" <cfajohnson@cfaj.ca> - 2020-04-01 23:40 -0400
    Re: tip for improving your shell skills Eli the Bearded <*@eli.users.panix.com> - 2020-04-02 17:17 +0000
    Re: tip for improving your shell skills Richard Kettlewell <invalid@invalid.invalid> - 2020-04-03 08:20 +0100
      Re: tip for improving your shell skills "Chris F.A. Johnson" <cfajohnson@cfaj.ca> - 2020-04-06 18:08 -0400

csiph-web