Jan Engelhardt wrote:
On Thursday 2013-02-28 04:59, Linda Walsh wrote:
if I type in: while read fn;do ls -l "$fn"; done < <('ls' -1)
into bash, I get a listing of files.
But if I put that line in a file. It doesn't work.
As usual, your bug reporting skills need much improvement. Like, _show_ us the file.
The above line is a sample 'test file' of one that doesn't work when executed under my default /bin/bash shell.
Why? Because of a suse-only patch to disable running such scripts under the user's shell, and only run them under /bin/sh.
What patch is it? Since you obviously know of it, you could have named it, i.e. the filename within the particular osc package.
---- Dunno about which file it is that patches it, but the results are in "execute_cmd..c" around line #5056: /* We have committed to attempting to execute the contents of this file as shell commands. */ #if 1 <<<<<------------Suse only larray = strvec_len(args) + 1; args = strvec_resize(args, larray + 1); for (i = larray - 1; i; i--) args[i] = args[i - 1]; args[0] = savestring(_PATH_BSHELL); args[1] = command; args[larray] = (char *)0; SETOSTYPE (0); /* Some systems use for USG/POSIX semantics */ execve ("/bin/sh", args, env); SETOSTYPE (1); internal_error (_("%s: cannot execute: %s"), command, strerror (errno)); #else initialize_subshell (); set_sigint_handler (); /* Insert the name of this shell into the argument list. */ larray = strvec_len (args) + 1; args = strvec_resize (args, larray + 1); for (i = larray - 1; i; i--) args[i] = args[i - 1]; args[0] = shell_name; args[1] = command; args[larray] = (char *)NULL; if (args[0][0] == '-') args[0]++; #if defined (RESTRICTED_SHELL) if (restricted) change_flag ('r', FLAG_OFF); #endif if (subshell_argv) { /* Can't free subshell_argv[0]; that is shell_name. */ for (i = 1; i < subshell_argc; i++) free (subshell_argv[i]); free (subshell_argv); } dispose_command (currently_executing_command); /* XXX */ currently_executing_command = (COMMAND *)NULL; subshell_argc = larray; subshell_argv = args; subshell_envp = env; unbind_args (); /* remove the positional parameters */ longjmp (subshell_top_level, 1); /*NOTREACHED*/ #endif
The above doesn't work under /bin/sh.
/bin/sh only gives you the guarantee of a POSIX shell. It may not recognize bashisms, of which I believe "<(commnad)" is one.
---- I know that. I'm running under /bin/bash. The code above ignores my currently running shell and runs the command under /bin/sh. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org