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


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

Re: tip for improving your shell skills

Path csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From Bit Twister <BitTwister@mouse-potato.com>
Newsgroups comp.os.linux.misc
Subject Re: tip for improving your shell skills
Date Wed, 1 Apr 2020 23:04:31 -0500
Organization A noiseless patient Spider
Lines 29
Message-ID <slrnr8ap2f.mlp.BitTwister@wb.home.test> (permalink)
References <eli$2004011957@qaz.wtf>
Injection-Info reader02.eternal-september.org; posting-host="1fbe707bbde9fd211d9790d1619fd763"; logging-data="2113"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ld+jsWldCW+VNI93+gbolGKW0GIPnu7k="
User-Agent slrn/1.0.3 (Linux)
Cancel-Lock sha1:mb2ht11QvlBQUHz0D/t6xszwHvg=
Xref csiph.com comp.os.linux.misc:29604

Show key headers only | View raw


On Thu, 2 Apr 2020 00:09:43 +0000 (UTC), 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. This makes it much easier to detect when any program
> you run has errors thus allowing you to learn from mistakes and avoid
> making them again. It will also prevent you from accidentally using
> undefined variables, so "rm -rf $HOM/bin" instead of "rm -rf $HOME/bin"
> won't delete (or attempt to delete) /bin.
>
> The enhanced error checking has long been recommended for shell scripts,
> but don't miss the opportunity to benefit from it on the command line,
> too.
>
> Elijah
> ------
> try also "set -C" for anti-clobber protection


Sounds good in theory, but can blow up in your face in the real world
resulting in your gui login to abort and return you to the gui log in
screen.  :(

Anytime you modify any of the login files I can recommend clicking up
a terminal and doing a  "su -l your_id_here" to verify your modification
does not cause problems.

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


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