I'm attempting to create a simple (test) script that are supposed to update some flatpak apps. However, I'm stuck on a basic issue - to get the loop to work.
Code: Select all
#!/bin/bash
# Declare an array of strings
lista = ( "org.freecad.FreeCAD" "vn.hoabinh.quan.CoBang" "net.giuspen.cherrytree" "org.avidemux.Avidemux" "com.xnview.XnViewMP" "com.rawtherapee.RawTherapee" )
for item in "${lista[@]}"; do
echo "flatpak update $item"
echo ""
done
Code: Select all
$ bash loop_list.sh
loop_list.sh: line 4: syntax error near unexpected token `('
loop_list.sh: line 4: `lista = ( "org.freecad.FreeCAD" "vn.hoabinh.quan.CoBang" "net.giuspen.cherrytree" "org.avidemux.Avidemux" "com.xnview.XnViewMP" "com.rawtherapee.RawTherapee" )'
What is wrong with the list declaration in my script ?
Code: Select all
System:
Kernel: 6.1.0-17-amd64 [6.1.69-1] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
parameters: BOOT_IMAGE=/boot/vmlinuz-6.1.0-17-amd64 root=UUID=<filter> ro quiet splash
Desktop: KDE Plasma v: 5.27.5 wm: kwin_x11 vt: 7 dm: SDDM Distro: MX-23.6_KDE_x64 Libretto
January 21 2024 base: Debian GNU/Linux 12 (bookworm)