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


Groups > linux.debian.user > #228275

Re: The .xsession-errors problem

From David <bouncingcats@gmail.com>
Newsgroups linux.debian.user
Subject Re: The .xsession-errors problem
Date 2020-10-27 01:30 +0100
Message-ID <B4l2a-4HA-3@gated-at.bofh.it> (permalink)
References <B4dR0-9W-7@gated-at.bofh.it> <B4kz7-4hS-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 27 Oct 2020 at 10:56, David Wright <deblis@lionunicorn.co.uk> wrote:

>       fuser -v "$j"
>       [ $? -ne 0 ] && gzip "$j" && mv -i "$j.gz" "$HOME/.monitors/xsession/"

[...]

> (Script improvements always appreciated.)

Hi, you might be interested in the info below :

my test script:
"""
#!/bin/sh
[ $? -ne 0 ] && echo hi
"""

https://www.shellcheck.net says:
"""
Line 2:
[ $? -ne 0 ] && echo hi
  ^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not
indirectly with $?.
"""

https://github.com/koalaman/shellcheck/wiki/SC2181 says:
"""
Running a command and then checking its exit status $? against 0 is
redundant. Instead of just checking the exit code of a command, it
checks the exit code of a command (e.g. [) that checks the exit code
of a command.
"""

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

The .xsession-errors problem Teemu Likonen <tlikonen@iki.fi> - 2020-10-26 17:50 +0100
  Re: The .xsession-errors problem Reco <recoverym4n@enotuniq.net> - 2020-10-26 18:10 +0100
    Re: The .xsession-errors problem Teemu Likonen <tlikonen@iki.fi> - 2020-10-27 16:10 +0100
      Re: The .xsession-errors problem rhkramer@gmail.com - 2020-10-27 20:20 +0100
  Re: The .xsession-errors problem Sven Joachim <svenjoac@gmx.de> - 2020-10-26 18:20 +0100
    Re: The .xsession-errors problem Teemu Likonen <tlikonen@iki.fi> - 2020-10-26 19:10 +0100
  Re: The .xsession-errors problem Linux-Fan <Ma_Sys.ma@web.de> - 2020-10-26 19:30 +0100
  Re: The .xsession-errors problem Tixy <tixy@yxit.co.uk> - 2020-10-27 00:10 +0100
    Re: The .xsession-errors problem John Hasler <jhasler@newsguy.com> - 2020-10-27 00:30 +0100
    Re: The .xsession-errors problem Greg Wooledge <wooledg@eeg.ccf.org> - 2020-10-27 13:00 +0100
      Re: The .xsession-errors problem Andrei POPESCU <andreimpopescu@gmail.com> - 2020-10-27 14:50 +0100
        Re: The .xsession-errors problem David <bouncingcats@gmail.com> - 2020-10-28 05:30 +0100
          Re: The .xsession-errors problem Andrei POPESCU <andreimpopescu@gmail.com> - 2020-10-28 12:50 +0100
          Re: The .xsession-errors problem Celejar <celejar@gmail.com> - 2020-10-28 19:40 +0100
            Re: The .xsession-errors problem David <bouncingcats@gmail.com> - 2020-10-29 00:10 +0100
              Re: The .xsession-errors problem Curt <curty@free.fr> - 2020-10-29 19:30 +0100
                Re: The .xsession-errors problem David <bouncingcats@gmail.com> - 2020-10-30 01:00 +0100
  Re: The .xsession-errors problem David Wright <deblis@lionunicorn.co.uk> - 2020-10-27 01:00 +0100
    Re: The .xsession-errors problem David <bouncingcats@gmail.com> - 2020-10-27 01:30 +0100
      Re: The .xsession-errors problem Greg Wooledge <wooledg@eeg.ccf.org> - 2020-10-27 13:00 +0100
        Re: The .xsession-errors problem David Wright <deblis@lionunicorn.co.uk> - 2020-10-29 18:40 +0100
  Re: The .xsession-errors problem Anders Andersson <pipatron@gmail.com> - 2020-11-01 11:20 +0100
    Re: The .xsession-errors problem Teemu Likonen <tlikonen@iki.fi> - 2020-11-01 17:50 +0100
      Re: The .xsession-errors problem Kenneth Parker <sea7kenp@gmail.com> - 2020-11-01 18:40 +0100

csiph-web