Bug 5612 - Ignore \r at the end of interpreter line
Summary: Ignore \r at the end of interpreter line
Status: REJECTED INVALID
Alias: None
Product: Other
Classification: Unclassified
Component: Other (show other bugs)
Hardware: i386 Linux
: P2 low
Assignee: other_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-15 12:13 UTC by Behdad Esfahbod
Modified: 2008-09-22 09:43 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.13
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
Patch (445 bytes, patch)
2006-07-03 13:49 UTC, Eric Sesterhenn
Details | Diff

Description Behdad Esfahbod 2005-11-15 12:13:45 UTC
Distribution: Fedora Core 4
Problem Description:

When a shell script or any other script using the hash-bang to run an
interpreter happens ot have Windows-style line termination (\r\n), trying to run
it returns "bad interpreter", because the kernel is parsing the \r as part of
the interpreter file name.

The kernel already ignores spaces at the end of the interpreter line.  It should
also ignore the \r character at the very end of the line.

Steps to reproduce:

Create a file test.sh containing the following line:

#!/bin/sh

Do unix2dos test.sh
Make it executable: chmod a+x test.sh
Try to run it: ./test.sh
Comment 1 Eric Sesterhenn 2006-07-03 13:49:34 UTC
Created attachment 8485 [details]
Patch

This trivial patch should fix this
Comment 2 Natalie Protasevich 2008-03-10 20:52:14 UTC
Eric, would you mind to submit the patch to lkml, since it won't be picked up from bugzilla.
Thanks.
Comment 3 Behdad Esfahbod 2008-09-22 09:43:25 UTC
Is this resolved or what?

Note You need to log in before you can comment on or make changes to this bug.