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

Charles M chaslinux at gmail.com
Mon Jun 5 18:00:40 EDT 2023


Thank you both, I'll try this when I get home.

On Mon, Jun 5, 2023, 5:59 PM Ronald Barnes <ron at ronaldbarnes.ca> wrote:

> Charles M wrote on 2023-06-05 14:00:
>
> > 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?
>
> Could it be a permissions issue?
>
>  From the dpkg-deb man page:
>
> > directory (but not its parents) will be created if necessary, and
> > its permissions modified to match the contents of the package.
>
> So, if the script is running with a user and extract target that do not
> have permissions to create the target directory, that's causing the
> failure?
>
>
> Of course, your final sentence seems to indicate otherwise, but I
> thought I'd throw this out there...
>
>
> rb
>
>
> _______________________________________________
> kwlug-disc mailing list
> To unsubscribe, send an email to kwlug-disc-leave at kwlug.org
> with the subject "unsubscribe", or email
> kwlug-disc-owner at kwlug.org to contact a human being.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20230605/31bbf79f/attachment.htm>


More information about the kwlug-disc mailing list