help-octave
[Top][All Lists]
Advanced

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

Strange behaviour of cd and ls command during tab completion


From: John W. Eaton
Subject: Strange behaviour of cd and ls command during tab completion
Date: Sat, 12 Dec 2009 09:49:10 -0500

On 12-Dec-2009, nikhilmehta_263 wrote:

| Hi,
| I have recently installed octave, and find that if I am using tab completion
| for searching a file or directory inside the pwd, it lists files that are
| simply not present in pwd. I suspect it lists octave commands or functions
| or toolboxes, etc beginning with the (partial) string I have typed.
| sample:
| octave:1> pwd
| ans = /home/nikhil
| 
| octave:2> ls -lh ./Dropbox/
| total 148K
| -rw-r--r-- 1 nikhil nikhil 102K 2009-10-01 14:40 Antenna Paradox.pdf
| drwxr-xr-x 9 nikhil nikhil 4.0K 2009-12-03 22:11 emc
| drwxr-xr-x 2 nikhil nikhil 4.0K 2009-11-08 21:45 friends
| -rw-r--r-- 1 nikhil nikhil 1.3K 2009-09-11 16:16 Getting Started.rtf
| drwxr-xr-x 3 nikhil nikhil 4.0K 2009-11-08 01:33 Photos
| drwxr-xr-x 6 nikhil nikhil 4.0K 2009-12-03 22:11 ProfAndres
| drwxr-xr-x 4 nikhil nikhil 4.0K 2009-11-08 01:31 psu_courses
| drwxr-xr-x 2 nikhil nikhil 4.0K 2009-11-08 01:33 Public
| -rw-r--r-- 1 nikhil nikhil  749 2009-10-08 21:33 RC_strip_rect_FEKO
| drwxr-xr-x 2 nikhil nikhil 4.0K 2009-11-18 12:17 resume
| -rw-r--r-- 1 nikhil nikhil  167 2009-11-30 12:37 to_do.txt
| 
| octave:3> cd ./Dropbox/empirical_
| empirical_cdf  empirical_inv  empirical_pdf  empirical_rnd
| 
| [in above command, I am using tab & it defaults to "empirical_", which is
| obviously not present in pwd, & note that it lists files none of which are
| present in pwd].
| 
| Am I missing something lame, what is the problem here?

In Octave, / is an operator and completion works on symbol names, not
just filenames, so it is completing the word after the /.

The completion code in your version of Octave (whatever that is; it is
always good to report that information when asking for help or
reporting a problem) is not smart enough to recognize that the 
completion is part of a cd command, so it is not doing filename
completion only.

This problem seems to already be fixed in the current development
version of Octave, so should be fixed in the next major release (i.e.,
3.4.x, but probably not any 3.2.x version).

jwe


reply via email to

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