[kwlug-disc] BASH scripting - dpkg or variable issue?

Charles M chaslinux at gmail.com
Mon Jun 5 17:00:21 EDT 2023


Hi all, I'm running into an issue where a BASH script is giving me the
following error:

dpkg-deb: error: --extract needs a target directory.
Perhaps you should be using dpkg --install ?

The error occurs after the following two lines in the script:

apt-get download shim.signed
dpkg -x $SHIMFILE shim

SHIMFILE is defined at the top of the script as:

SHIMFILE=$(ls | grep "shim.signed")

If I echo $SHIMFILE after the script has ended it shows:

shim-signed_1.40.9+15.7-0ubuntu1_amd64.deb

If I type the commands in to the terminal everything works... but it
doesn't if I use the script... what am I missing?

Thanks,

Charles
-- 
Charles
Mastodon: @chaslinux at techhub.social



More information about the kwlug-disc mailing list