Skip to content

Linux Agent: Update all instances of '[...]' to '[[...]]'#21

Closed
rawiriblundell wants to merge 1 commit into
Checkmk:masterfrom
rawiriblundell:master
Closed

Linux Agent: Update all instances of '[...]' to '[[...]]'#21
rawiriblundell wants to merge 1 commit into
Checkmk:masterfrom
rawiriblundell:master

Conversation

@rawiriblundell
Copy link
Copy Markdown
Contributor

Hi,
bash, ksh and zsh all support [[ ]], which is more capable, more robust/safer and it is faster. This is technically an (admittedly miniscule) optimisation as well as a style change.

@svenpanne
Copy link
Copy Markdown
Contributor

I am very reluctant to make such a change for portability reasons. Currently we have 10 different shell-based agents, and our goal is to reduce these to 2: The OpenVMS agent is totally different, but the 9 other ones can and should be merged at some point. Furthermore, the agents have to run on really old platforms, like ancient Solaris/AIX versions etc. with really ancient and primitive shells. So we simply can't assume even slightly modern features, everything should run on some #!/bin/sh, be it effectively an ash, sh, bash, dash, ... We are not there yet, but we should use less bash-isms, not more, so this pull request goes into the wrong direction.

FYI: https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Portable-Shell.html has quite some info about things to avoid. As a general rule of thumb: If a shell feature is not used by a standard configure script, avoid it.

@mike1098
Copy link
Copy Markdown
Contributor

mike1098 commented Jan 21, 2020

@svenpanne : IN AIX /bin/sh is linked to korn shell:

`sh Command

Purpose

   Invokes the default shell.

Syntax

   Refer to the syntax of the ksh command. The /usr/bin/sh file is linked to the Korn shell.

Description

   The sh command invokes the default shell and uses its syntax and flags. The shell linked to the /usr/bin/sh path is the default shell. The standard configuration of the operating system links the /usr/bin/sh path to the Korn
   shell.

Flags

   Refer to the flags for the Korn shell (ksh command).

Files

   Item
        Description
   /usr/bin/sh
        Contains the sh command.

`

LarsMichelsen pushed a commit that referenced this pull request May 2, 2022
Clean up

 - cmk.gui.watolib.wato_background_job

and a few imports that were barely used, if at all,

 - cmk.gui.watolib.user_scripts
 - cmk.gui.watolib.users

CMK-10313

Change-Id: Ia8892ca6e5fdedf4863cc7b4c2aa5159c5b82e08
CheckmkCI pushed a commit that referenced this pull request Jul 8, 2024
Change-Id: I14d6d2730100a184753c08ae9bd8dfe5b2ec6389
CheckmkCI pushed a commit that referenced this pull request Jul 10, 2024
Change-Id: If6a7bb9c8161c1709f44a39e41f96667b0dcb16e
CheckmkCI pushed a commit that referenced this pull request Aug 12, 2025
Change-Id: Ibeaa98a162c829badf5496649e0936ebe87407ca
CheckmkCI pushed a commit that referenced this pull request Nov 15, 2025
Change-Id: I2f57406989a3b2e81315ae38c051c46f2fb92782
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants