[GTALUG] Command doesn't work in script but works on command line?

Giles Orr gilesorr at gmail.com
Sat Nov 6 11:02:21 EDT 2021


On Sat, 6 Nov 2021 at 10:04, D. Hugh Redelmeier via talk
<talk at gtalug.org> wrote:
>
> | From: Jim Ruxton via talk <talk at gtalug.org>
>
> | I'm having trouble with a simple script. It adds a second sounccard. This
> | command works on the command line but not in a script. Any ideas why?
>
> How are you running that script?  Is it from a cron script or something
> like it?  Does your script work when invoked from your command line?
>
> I haven't paid attention to JACK, but I assume that each Linux user
> session has some kind of jack context -- plumbing done by one user should
> not affect the plumbing of another user.  I don't really see this issue
> addressed in the first few jack documents I read.
>
> My guess is that your script is modifying a different context from the one
> you are observing.  That's really vague and hand-wavy, but that's the
> direction I'd investigate.
> ---
> Post to this mailing list talk at gtalug.org
> Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk

Similar to Hugh's ideas, but more specific, I would check first the
PATH (mentioned by several other people) and then the environment as a
whole.  I'm not sure that what I'm going to suggest is the best way to
do this, but it's the one I know: run the command 'export' and look
for any settings that look to be specific to the program you're
running, then make sure those same settings are set in the script
you're working on.  You can look at the PATH this way as well.
Scripts often (especially under cron) run in different environments
from what you expect, and thus don't get the information they need to
function properly.

-- 
Giles
https://www.gilesorr.com/
gilesorr at gmail.com


More information about the talk mailing list