dash does not read IFS properly

Bug #285651 reported by Mike H
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dash (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: dash

When IFS is set in a script, and the script as started with dash, dash doesn't understand IFS properly.
IFS is set and the script name has a n or a t in it's name, dash removes those characters.
eg. script: /home/username/bin/testnew.sh
=========
#/bin/dash
IFS=' \t\n'
echo $0
=========

result:
/home/user ame/bi / es ew.sh

expected result:
/home/username/bin/testnew.sh

the same result happens if script is #!/bin/bash or #!/bin/sh and it is started with 'dash scriptname', since Ubuntu points /bin/sh -> /bin/dash this happens in almost every script.

Revision history for this message
pelle.k (pele2) wrote :

Hi.
About the IFS "issue", i found an satisfactory explanation explanation for this here;
http://forum.soft32.com/linux2/Bug-409179-DASH-Settings-IFS-work-properly-ftopict70039.html
To sum it up, you should use

<CODE>
IFS='
'
</CODE>

instead, since the bash syntax isn't specified in POSIX.
As for how and under what conditions are run, look here;
http://ubuntuforums.org/showthread.php?t=438355

So, to sum it up, i *think* this bug should be marked as "INVALID".

Revision history for this message
pelle.k (pele2) wrote :

I need to clarify;
What i did above is to set IFS to "newline only". To set IFS to whitespace/tab/newline (e.g. reset it, you should use "unset IFS"). I was too quick to respond :)

Revision history for this message
pelle.k (pele2) wrote :

Ok, closing as invalid, for the above reason.

Changed in dash (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.