Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 6 Mar 2001 08:56:12 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 6 Mar 2001 08:55:53 -0500 Received: from tomcat.admin.navo.hpc.mil ([204.222.179.33]:29016 "EHLO tomcat.admin.navo.hpc.mil") by vger.kernel.org with ESMTP id ; Tue, 6 Mar 2001 08:55:47 -0500 Date: Tue, 6 Mar 2001 07:55:15 -0600 (CST) From: Jesse Pollard Message-Id: <200103061355.HAA96253@tomcat.admin.navo.hpc.mil> To: schwab@suse.de, Paul Flinders Subject: Re: binfmt_script and ^M Cc: Paul Flinders , Jeff Mcadams , Rik van Riel , John Kodis , "Richard B. Johnson" , linux-kernel@vger.kernel.org, bug-bash@gnu.org X-Mailer: [XMailTool v3.1.2b] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Andreas Schwab :Andreas Schwab Andreas Schwab > Paul Flinders writes: > > |> Andreas Schwab wrote: > |> > |> > This [isspace('\r') == 1] has no significance here. The right thing to > |> > |> > look at is $IFS, which does not contain \r by default. The shell only splits > |> > |> > words by "IFS whitespace", and the kernel should be consistent with it: > |> > > |> > $ echo -e 'ls foo\r' | sh > |> > ls: foo: No such file or directory > |> > |> The problem with that argument is that #! can be applied > |> to more than just shells which understand $IFS, so which environment > |> variable does the kernel pick? > > The kernel should use the same default value of IFS as the Bourne shell, > ie. the same value you'll get with /bin/sh -c 'echo "$IFS"'. This is > independent of any settings in the environment. > > |> It's a difficult one - logically white space should terminate the interpreter > > No, IFS-whitespace delimits arguments in the Bourne shell. IFS can be defined in the environment. The kernel cannot use that definition because it introduces buffer limits and a potential overflow. Besides, the kernel can run scripts from applications that may not have or pass IFS, or it's equivalent in whatever shell is being used (I seem to remember an Icon shell that used commas). ------------------------------------------------------------------------- Jesse I Pollard, II Email: pollard@navo.hpc.mil Any opinions expressed are solely my own. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/