This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: "ls" command not working in windows 2008


[reformatted: see http://www.cygwin.com/acronyms/#TOFU ]

On 2009-04-06 12:41Z, sudhap85 wrote:
> 
> Greg Chicares-2 wrote:
>> 
>> On 2009-04-06 12:14Z, sudhap85 wrote:
>>> I tried to list the contents of a directory in DOS command prompt and
>>> redirecting it to a file.This did not add the contents at all.
>>> âls $root/virusScanBase >> $resultfileâ
>>> 
>>> As an alternative to this I tried to use
>>> "echo $root/virusScanBase/*" but this just returns * and not the
>>> directory
>>> contents(in Linux it works as expected by listing direcory contents)
>> 
>> What shell are you using? By "DOS command prompt", do you mean CMD.EXE?
>> Or is this Cygwin's 'bash'?
>> 
>> What output do you see from the following commands?
>>   echo $root
>>   echo %root%
>
> Yes this CMD.exe and $root is just a variable which holds a directory name
> and it would expand as
> (virusscanbase is a directory)
> âls /tmp/virusScanBase >> resultfileâ

What is the syntax for environment variables in your version of CMD.EXE?
Does the *nix shell syntax:
  echo $variable
work, or does it instead require:
  echo %variable%
because CMD.EXE is not a *nix shell?

It is the shell, not 'ls', that substitutes command-line arguments.
Running Cygwin's 'ls' doesn't make CMD.EXE behave like a *nix shell.
If you want things to work as they do on GNU/Linux, then perhaps you
should consider using Cygwin's 'bash' instead of CMD.EXE .

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]