This is the mail archive of the cygwin@sourceware.cygnus.com 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]

Problem with nested command substitution


Hi,

I am new to the list, so please forgive me if I am asking about the
obvious... 

The problem I have is when I try to execute something like

  for f in *.txt; do x=`basename $f .txt`; mv $f $x.dat; done

I get an error from Win95 (the famous illegal operation window) where
it claims that Sh has caused an invalid page fault in module
KERNEL32.DLL at 0137:bff782b8, and dumps the registers.
In the example, I will get the error for as many .txt files there are
in the directory.

Interestingly enough, if I run the command that was in the nested
invokation alone, first, as in:

  basename --version > /dev/null
  for f in *.txt; do x=`basename $f .txt`; mv $f $x.dat; done

NO errors occur.

Can someone help me in finding what may be wrong?

Thanks,
Simao Campos
COMSAT Labs

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


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