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: bash command in cygwin


Vaclav Haisman wrote on Friday, March 09, 2007 2:57 AM:
> ovince wrote:
>> I managed to do everything in Cygwin that I was doing in Unix. This
>> is the first thing that does not want to work. It is a simple bash
>> command 
>> 
>> for file in 'cat listBox1.txt'; do awk '{print $0}'; done
>
> I doubt this works anywhere. You are using simple apostrophes instead
> of `backticks`. 
> 
>> Could you tell me what I do wrong here?

Also, you are not giving awk anything to work on.  With no file, it will
wait for stdin, which is not giving anything either.  You probably meant

  for file in `cat listBox1.txt`; do awk '{print $0}' ${file} ; done

Also, the
	$( command or pipe )
synonym for
	` command or pipe `
is more versatile than backticks and something with which you should
familiarize yourself.

- Barry
  Disclaimer: Statements made herein are not made on behalf of NIAID.

--
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]