[Bug 799241] New: ls command fails when IFS is set to exclude space character, because of the default alias (fix provided)
https://bugzilla.novell.com/show_bug.cgi?id=799241 https://bugzilla.novell.com/show_bug.cgi?id=799241#c0 Summary: ls command fails when IFS is set to exclude space character, because of the default alias (fix provided) Classification: openSUSE Product: openSUSE 12.2 Version: Final Platform: All OS/Version: openSUSE 12.2 Status: NEW Severity: Minor Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: peter.maloney@brockmann-consult.de QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Firefox/17.0 ls command fails when IFS is set to exclude space character, because of the default alias. It has an error message: ls: invalid option -- ' ' Here is the fix (using an array instead of a string, so the IFS variable is only used when setting the array, not every time ls is run): IFS=' ' LS_OPTIONS2=($LS_OPTIONS) alias ls='ls ${LS_OPTIONS2[@]}' I have this in my ~/.bash_profile now, but if this was made the default ls alias, then it would work by default. Other distros (eg. debian and Ubuntu) have a different alias (alias ls='ls --color=auto'), and don't have this problem. Reproducible: Always Steps to Reproduce: The expected output: $ ls device.map e2fs_stage1_5 ffs_stage1_5 jfs_stage1_5 menu.lst.old reiserfs_stage1_5 stage2 ufs2_stage1_5 xfs_stage1_5 device.map.old fat_stage1_5 iso9660_stage1_5 menu.lst minix_stage1_5 stage1 stage2.old vstafs_stage1_5 The problem: $ IFS=$'\n' $ ls ls: invalid option -- ' ' Try `ls --help' for more information. The fix: $ IFS=' ' LS_OPTIONS2=($LS_OPTIONS) $ alias ls='ls ${LS_OPTIONS2[@]}' $ ls device.map e2fs_stage1_5 ffs_stage1_5 jfs_stage1_5 menu.lst.old reiserfs_stage1_5 stage2 ufs2_stage1_5 xfs_stage1_5 device.map.old fat_stage1_5 iso9660_stage1_5 menu.lst minix_stage1_5 stage1 stage2.old vstafs_stage1_5 Actual Results: $ ls ls: invalid option -- ' ' Try `ls --help' for more information. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=799241
https://bugzilla.novell.com/show_bug.cgi?id=799241#c
Du Weihua
https://bugzilla.novell.com/show_bug.cgi?id=799241
https://bugzilla.novell.com/show_bug.cgi?id=799241#c1
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=799241
https://bugzilla.novell.com/show_bug.cgi?id=799241#c2
--- Comment #2 from Peter Maloney
https://bugzilla.novell.com/show_bug.cgi?id=799241
https://bugzilla.novell.com/show_bug.cgi?id=799241#c3
--- Comment #3 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=799241
https://bugzilla.novell.com/show_bug.cgi?id=799241#c4
--- Comment #4 from Peter Maloney
https://bugzilla.novell.com/show_bug.cgi?id=799241
https://bugzilla.novell.com/show_bug.cgi?id=799241#c5
Peter Maloney
https://bugzilla.novell.com/show_bug.cgi?id=799241
https://bugzilla.novell.com/show_bug.cgi?id=799241#c6
--- Comment #6 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=799241
https://bugzilla.novell.com/show_bug.cgi?id=799241#c7
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=799241
https://bugzilla.novell.com/show_bug.cgi?id=799241#c8
--- Comment #8 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=799241
https://bugzilla.novell.com/show_bug.cgi?id=799241#c9
--- Comment #9 from Bernhard Wiedemann
participants (1)
-
bugzilla_noreply@novell.com