X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_82 X-Spam-Check-By: sourceware.org Message-ID: <49D9FC40.8010607@sbcglobal.net> Date: Mon, 06 Apr 2009 12:57:36 +0000 From: Greg Chicares User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: "ls" command not working in windows 2008 References: <22907575 DOT post AT talk DOT nabble DOT com> <49D9F723 DOT 3010103 AT sbcglobal DOT net> <22908018 DOT post AT talk DOT nabble DOT com> In-Reply-To: <22908018.post@talk.nabble.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com [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/