↓ Skip to main content
Linux

Notes: For self

·1 min
  • Bash is a string oriented language
  • We do not write step=$((step++)) this expression will return a numeric value which the shell will then take as the command to to be executed.
  • No spaces are allowed around the equal sign for variable assignment.
  • let "step++" is same as (( step++ ))
  • Use declare to set variable values and attributes
In bash = and == both mean the same thing

💬 What is the difference between [ and [[?

  1. •

    if cd $dir; then

    In this case the command cd $dir will be executed and based on success or failure of the command executed the if or else part will be executed respectively.

    if [$dir]; then
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#if-dir-then" aria-label="Anchor">#</a>
    </span>
    

    Single bracket is equivalent to test command evaluate conditional expression

    1. •

      < & >

      • Within [ compare using simple ASCII ordering & within [[ comparison is lexicographic.
      • Within [ you have to escape \> to avoid redirection.

💬 BC is a language?

  <span></span>
</span>
<span class="accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden">
  <span class="relative block icon"><svg

xmlns=“http://www.w3.org/2000/svg" viewBox=“0 0 20 20” fill=“currentColor” aria-hidden=“true”

💬 Supports arbitrary precision numbers with interactive execution of statements. (Command line)

awk provides filtering capabilities

> printf 'gate\napple\nwhat\nkite\n' | awk '/at/'

gate
what
printf 'gate\napple\nwhat\nkite\n' | awk '!/e/'

what

awk is primarily used for field based processing

One liner structure awk 'cond1{action1} cond2{action2} … condN{actionN}'

Author
Samarthya
Engineer, learner, tinkerer. This is my trophy shelf of everyday work and leisure.

Related

Spinnaker: docker-registry

You will need a valid docker registry before you add any trigger in the pipeline in Spinnaker Official documentation is a good resource to seek more clarifications — Spinnaker In my case I have already added an account my-docker-registry as under (The final result after you successfully configure Docker.

Zabbix Agent

·3 mins
In this blog I will walk you through basic steps needed to deploy a Zabbix 5 Agent on a Centos Machine. The Zabbix Release is available here. Machine # root@node4>cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) Download and install the RPM