Problem with nested command substitution

Simao Campos
Tue Aug 4 13:07:00 GMT 1998


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

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?

Simao Campos

For help on using this list (especially unsubscribing), send a message to
"" with one line of text: "help".

More information about the Cygwin mailing list