Linux shell debug

< hr > I don"t understand this paragraph in

figure. If you can, please describe this syntax rule and calling sequence in detail. Thank you

.

figure code:

-sharp!/bin/bash
function DEBUG()
{
    [ "$_DEBUG" == "on" ] && $@ || :
}
for i in {1..10}
do
    DEBUG echo $i
done
< hr >

May.07,2022

["$_ DEBUG" = = "on"] & & $@ | |:
This sentence is divided into three parts

  1. ["$_ DEBUG" = = "on"]
    this is a conditional expression that checks whether the value of the environment variable _ DEBUG is equal to on .
  2. $@
    this executes the function argument as a command. In this case, the function argument is "echo xx".
  3. :
    this is an empty command, do nothing.

these three parts are connected in series by & & and | to form cond & & cmd1 | | cmd2 structure.
means that cmd1 is executed when the cond condition is true, otherwise cmd2 .

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b385f8-4114c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b385f8-4114c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?