[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[coreutils-6.9] multiple utilities not handling escape char(\) properly
From: |
Wilber Washbucket |
Subject: |
[coreutils-6.9] multiple utilities not handling escape char(\) properly when used with -, instead interpreting as option(could be a bash bug?) |
Date: |
Wed, 18 Jul 2007 01:37:26 +1000 |
ClarkConnect Community Edition release 4.0 (kernel 2.6.9-42.cc)
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
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!!
testdir]# ../src/touch \\-bar2
^^ Trying a double backslash to see what happens
testdir]# ls
+foo0 +foo1 \-bar2
^^ It is what is expected.
testdir]# ../src/touch '-bar3'
../src/touch: invalid option -- e
Try `../src/touch --help' for more information.
^^ Trying single quotes
testdir]# ../src/touch "-bar4"
../src/touch: invalid option -- e
Try `../src/touch --help' for more information.
^^ Trying double quotes
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.
testdir]# ../src/mv +foo0 \-bar6
../src/mv: invalid option -- e
Try `../src/mv --help' for more information.
^^ This is wrong, this should work!!
testdir]# ../src/touch ./-bar7
testdir]# ../src/touch ./\-bar8
testdir]# ls
+foo0 +foo1 \-bar2 -bar7 -bar8
testdir]#
As you can see from the above commands, \-barX is being interpreted as an
option to touch/mv/etc instead of being part of the
filename.
Hooroo,
Wilber
- [coreutils-6.9] multiple utilities not handling escape char(\) properly when used with -, instead interpreting as option(could be a bash bug?),
Wilber Washbucket <=