help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unable to run bash loadable in crontab on Mac OS X


From: Peng Yu
Subject: Unable to run bash loadable in crontab on Mac OS X
Date: Tue, 29 Aug 2023 14:00:32 -0500

Hi,

I have the following line in crontab.

$ crontab -l
* * * * * LANG=en_US.UTF-8 /usr/local/bin/bash -c 'export
BASH_LOADABLES_PATH=$HOME/Downloads/bash-5.2.15/examples/loadables;
builtin enable -f realpath realpath' >/tmp/crontab_stdout.log
2>/tmp/crontab_stderr.log

The shared library file realpath is there.

$ cd $HOME/Downloads/bash-5.2.15/examples/loadables
$ ls -lgG realpath
-rwxr-xr-x 1 51288 2023-08-17 08:01:49 realpath
$ file realpath
realpath: Mach-O 64-bit dynamically linked shared library x86_64
$ /usr/local/bin/bash --version | head -n 1
GNU bash, version 5.2.15(1)-release (x86_64-apple-darwin21.6.0)

But I see the following error.

$ cat /tmp/crontab_stderr.log
/usr/local/bin/bash: line 1: enable: cannot open shared object
realpath: dlopen(realpath, 0x0001): tried: 'realpath' (no such file),
'/usr/local/lib/realpath' (no such file), '/usr/lib/realpath' (no such
file), '/Users/pengy/realpath' (no such file)

The command `builtin enable -f realpath realpath` can run correctly in
a login bash session.

Why can't it run in crontab? Thanks.

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]