
Gibt es eine Möglichkeit, die Variable $i automatisch vor den Befehlsanfang zu stellen, ohne sie jedes Mal angeben zu müssen?
Hier ist mein aktuelles Skript.
#!/bin/bash
for i in "command -c"; do
$i command1 show
$i command2 show
done
Was ich möchte, ist so etwas.
#!/bin/bash
for i in "command -c"; do
$i
(
command1 show
command2 show
)
done