SliTaz SliTaz Forum

You are not logged in.

#1 2026-01-15 14:28:59

gibor
Moderator
Registered: 2011-04-30
Posts: 1,067

Tazpkg command explanations

Hello, when analyzing receipts, I often find commands that do not seem to belong to the coreutils sphere (nor to the emulated busybox).

E.g.: ! grep -qs

The similarity to “if” is obvious, but I do not understand how it works exactly.

Or again:

[ -s /etc/$i ]

Like the previous example, this should be a file check.

Are they perhaps part of the framework undergrowth with which Slitaz is managed?

If so, it would be useful to know where to find information about those commands and how they are managed.

Thank you!

------------------------------------------------------------------------

Salve, analizzando i receipt trovo spesso comandi che sembrano non appartenere alla sfera di coreutils (e nemmeno delle emulate busybox).

Es: ! grep -qs

si intuisce la similitudine con “if” ma non ne capisco l'esatto funzionamento

o ancora

[ -s /etc/$i ]

come l'esempio precedente dovrebbe essere un check file.

Fanno forse parte di quel sottobosco del framework con cui slitaz è gestito?

Se sì, sarebbe utile sapere dove si trovano le informazioni relative a quei comandi e come vengono gestite.

Grazie!

Offline

#2 2026-01-15 20:04:18

shann
Administrator
Registered: 2011-04-01
Posts: 1,296
Website

Re: Tazpkg command explanations

Hi gibor,

I doing test on debian, code below work on bash, dash shell.

Not specific to SliTaz

----

Ciao Gibor,

Sto eseguendo dei test su Debian, il codice qui sotto funziona su bash e dash shell.

Non è specifico di SliTaz

! grep -q debian /etc/debian_version && echo here

here

Offline

#3 2026-01-16 07:01:15

gibor
Moderator
Registered: 2011-04-30
Posts: 1,067

Re: Tazpkg command explanations

Hi Shann

I still don't understand how to use it.

https://www.pluralsight.com/resources/blog/cloud/conditions-in-bash-scripting-if-statements

If the condition “!” is equivalent to negation, the use requires the use of “if”.

E.g.:

if ! grep -qs ‘messagebus’ “$1/etc/passwd”

      then

-

fi

In practice, if grep does not find the string in /etc/passwd, it executes the “then” command.

With the direct command, what happens instead?

[ -s “$1” ] &&

    ! grep -qs  in  “$1/etc/inetd.conf” &&

    cat >> “$1/etc/inetd.conf” <<EOT

#rsync    stream    tcp    nowait    root    rsync    rsync    -daemon

EOT

    true

checks for the existence of /etc/inetd.conf

if grep does not find the string  rsync /etc/inetd.conf then it executes the commands following &&

otherwise, does it skip “cat”?

Offline

#4 2026-01-16 08:04:05

shann
Administrator
Registered: 2011-04-01
Posts: 1,296
Website

Re: Tazpkg command explanations

Hi gibor,

For code you post, you are right and should read this.

[c][ -s "$1/etc/inetd.conf" ][/c] if /etc/inetd.conf file found return true

[c]! grep -qs rsync in $"1/etc/inetd.conf"[/c] if rsync string not found in /etc/inetd.conf return true

with [c]&&[/c] aka and logical, previous condition should be true to each part execute.

if file found => search rsync string executed

if file found and search rsync string not found => run cat command

if file found not true or search if rsync string not found not true => command cat not running

Hope i clear in explain.

Offline

#5 2026-01-16 08:30:11

gibor
Moderator
Registered: 2011-04-30
Posts: 1,067

Re: Tazpkg command explanations

Yes, thank you, that's better. However, the strange thing is that I can't find any literature on the subject.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.043 seconds, 7 queries executed - Memory usage: 1.54 MiB (Peak: 1.77 MiB) ]