Thank you for the fix. I'll study and commit the changes. /bin/sh (dash) is posix and should be available in all *nix distros, and I intend (and already done some) replace bash with sh in shell scripts.
On Fri, 18 Feb 2022 at 11:29 AM Raul Miller <[email protected]> wrote: > Actually, a better option here (better than #!/bin/bash) would be to > leave the shebang line as #!/bin/sh and to instead remove the > dependency on bash. > > Instead change line 29 (or 30, if you have taken my advice and > implemented an initial cd to the directory containing install-usr.sh) > to read: > > [ j903 = "$(basename "$(pwd)")" ] || { echo directory not j903; exit 1 } > > Optionally you could include some quotes which were originally on that > line, but they are unnecessary here. > > FYI, > > -- > Raul > > On Thu, Feb 17, 2022 at 7:10 PM Raul Miller <[email protected]> wrote: > > > > I'm installing j on a linux system. > > > > And, I ran into some issues with the j903/bin/install-usr.sh > > > > Specifically, if the system /bin/sh is not bash but some other sh > > implementation, such as dash, running the script will give the > > message: 'directory not j903' > > > > I believe the right fix for this would be to change the initial line to: > > > > #!/bin/bash > > > > Also, it assumes that it's being run with j903/bin as the current > > directory. To make this more general, I think that before it executes > > 'cd ..' it should execute: > > > > cd -P "$(dirname "$0")" > > > > Thanks, > > > > -- > > Raul > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
