octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #62282] ls command in 7.1.0 may not function


From: Rik
Subject: [Octave-bug-tracker] [bug #62282] ls command in 7.1.0 may not function
Date: Thu, 21 Apr 2022 15:15:29 -0400 (EDT)

Follow-up Comment #33, bug #62282 (project octave):

I checked in a small change to the wording of the documentation for ls and dir
(http://hg.savannah.gnu.org/hgweb/octave/rev/0acf9363da34) that was slightly
better to my native English-speaking ear.

However, I now have a question about how well this the escape patterning is
working on both Windows and Linux.

For Windows, the escaping of regular expressions is


        ## Exclude glob patterns and escaped characters from quoted part of
        ## FILENAMES string
        args = regexprep (args, '(?<!\\)([*?])', '"$1"');
        args = regexprep (args, '(?<!\\)\[', '"[');
        args = regexprep (args, '(?<!\\)\[', ']"');
        args = regexprep (args, '(\\.)', '"$1"');


It doesn't look to me like this handles the case of ']'.  Could someone test
this on Windows?


# In a shell
touch 'abc]def'
# In octave
ls abc\]def


Second question is how escaped characters are supposed to behave on Linux.  I
did this


# In a shell
touch 'abc?def'
touch 'abc*def'
touch 'abc[def'


In Octave when I try


octave:1> ls abc\?def
ls: cannot access 'abc\?def': No such file or directory
error: ls: command exited abnormally with status 2


However, that same syntax in the shell works just fine.  So I think there is
something wrong on Linux platforms as well.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62282>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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