bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [coreutils-6.9] multiple utilities not handling escape char(\) prope


From: Philip Rowlands
Subject: Re: [coreutils-6.9] multiple utilities not handling escape char(\) properly when used with -, instead interpreting as option(could be a bash bug?)
Date: Tue, 17 Jul 2007 17:48:38 +0100 (BST)

On Wed, 18 Jul 2007, Wilber Washbucket wrote:

I compiled the latest coreutils from source. Then I ran these series of 
commands:
coreutils-6.9]# mkdir testdir
coreutils-6.9]# cd testdir/
testdir]# ../src/touch +foo0
testdir]# ../src/touch \+foo1
testdir]# ../src/touch -bar0
../src/touch: invalid option -- e

Really? There is no option "e" specified.

Try `../src/touch --help' for more information.
^^ That error is correct as the - char is used for options.

testdir]# ../src/touch \-bar1
../src/touch: invalid option -- e
Try `../src/touch --help' for more information.
^^ This is wrong, this should work!!

This isn't due to coreutils, nor is really a bash bug; rather it's an artifact of how shell escaping works. Please try "set +x" in bash to view the commandlines after escape-processing, to see how touch is actually seeing your commands.

testdir]# ../src/mv +foo0 -bar5
../src/mv: invalid option -- e
Try `../src/mv --help' for more information.
^^ That error is correct as the - char is used for options.

That's a slightly different issue. coreutils are permissive in their options parsing. By setting the environment variable POSIXLY_CORRECT, this command will complete without error.


Cheers,
Phil




reply via email to

[Prev in Thread] Current Thread [Next in Thread]