On 2023/03/30 22:59:08 +0800, lux <l...@shellcodes.org> wrote: > On Thu, 2023-03-30 at 16:31 +0200, Omar Polo wrote: > > > > Furthermore, the man page explicitly states that script -c runs > > sh(1): > > > > -c command > > Run sh -c command, instead of an interactive shell. > > [...] > > > > So I'd say that script(1) is working as intended. What was exactly > > the issue that you were trying to solve? > > > > > > Sorry, I didn't read the manual carefully. > > I have two types of shell scripts. When selecting different types of > shell to execute script through $0, and did not work as expected. Then > I looked at the source code and could specify the shell through the > $SHELL environment variable, but finally sh was executed, so, I thought > it was a bug.
If your scripts are executable script -c ./foo (with foo being your script) should work. sh would exec `foo' which -hopefully- has the correct interpreter in its shebang (i.e. csh, sh, ksh, perl, lua...)