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: Fwd: bash script bugs

On 12/02/2009 08:20 PM, Sergey Ivanov wrote:
Have a script:
f="$(ls $1)"
for v_file in "$f"; do
  echo $v_file

Twos things do not work as they should. By order:
1) Output in command line for nest commands
  ls /cygdrive/d/install/buf/*.html
  dir /cygdrive/d/install/buf/*.html
is same:

while output for ./
/cygdrive/d/install/buf/*.html is only

This is no bug. It's a user error. If you want to show
both files you either need to escape the '*' in the parameter your pass to it or have
the script process all the parameters (i.e. $*) with the internal 'ls' command.

2) (not critical but not "classical") Both command line script and
outputs for current folder in one line:
ls returns  cygcheck.out  sources
and so ./ do

That seems "classical" to me. If you prefer 1 file per line, use the '-1' flag.

Larry Hall                    
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
216 Dalton Rd.                          (508) 893-9889 - FAX
Holliston, MA 01746


A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

Problem reports:
Unsubscribe info:

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