I have an Arch Linux machine with Openbox, and I want to run an update on my autostart script (bash) - so I added the following command to my autostart: rxvt -e sudo pacman -Syu & (i.e. open rxvt terminal and run the standard update command for Archlinux's package manager, pacman).However, sometimes the database is locked by another pacman process, and then the command fails and just closes rxvt without doing anything - so I wanted to remove the lock first by using rxvt -e  sudo rm /var/lib/pacman/db.lck && sudo pacman -Syu & (remove the lock on pacman and then update). This doesn't work as actually only the first command is executed in the rxvt instance.Is there any way to get it right (running two commands on a terminal opened with a -e flag)? I know I could open two separate terminals, each executing one command, but that would be really messy in my opinion. Alternatively, if there's another simpler way to make sure the lock isn't there, it's also okay by me (although I prefer it on the same terminal so I can see the output of the rm clearly)
terminal -e with multiple commands
bash;terminal
Use quotes to make this a single command:rxvt -e  sudo rm /var/lib/pacman/db.lck && sudo pacman -Syu &Some terminals need that to be wrapped in a shell command, e.g.,rxvt -e sh -c sudo rm -f /var/lib/pacman/db.lck && sudo pacman -Syu &The -f flag ignores the file if it's not there and avoids an error