Mercurial > octave
comparison scripts/miscellaneous/ls.m @ 30267:535f97bb5f86
ls: Use "ls" command also on Windows if available.
* scripts/miscellaneous/ls_command.m: "file_in_path" doesn't take PATHEXT into
account. Use "where" command instead to check if "ls" executable is available
on MinGW. Adjust condition in BIST.
* scripts/miscellaneous/ls.m: Use argument "-1" if "ls" command is used.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Mon, 01 Nov 2021 14:37:01 +0100 |
parents | 0a5b15007766 |
children | 796f54d4ddbf |
comparison
equal
deleted
inserted
replaced
30266:38ee67b5ec9f | 30267:535f97bb5f86 |
---|---|
83 args = sprintf ("%s ", args{:}); | 83 args = sprintf ("%s ", args{:}); |
84 else | 84 else |
85 args = ""; | 85 args = ""; |
86 endif | 86 endif |
87 | 87 |
88 if (nargout > 0 && (isunix () || ismac ())) | 88 ls_cmd = ls_command (); |
89 if (nargout > 0 && strncmp (ls_cmd, "ls", 2)) | |
89 args = ["-1 ", args]; | 90 args = ["-1 ", args]; |
90 endif | 91 endif |
91 | 92 |
92 cmd = [ls_command() " " args]; | 93 cmd = [ls_cmd, " ", args]; |
93 | 94 |
94 if (page_screen_output () || nargout > 0) | 95 if (page_screen_output () || nargout > 0) |
95 [status, output] = system (cmd); | 96 [status, output] = system (cmd); |
96 | 97 |
97 if (status != 0) | 98 if (status != 0) |