cygwin on windows7


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting cygwin on windows7
# 1  
Old 09-15-2011
cygwin on windows7

Guys,

I am new to this site and ksh scripting. I am trying to run the following code on cygwin on windows 7 but it keeps giving me syntax error. For some reason, it works on my buddies comp but not on my laptop. Done anyone know whats going on here?

Code:
#!/usr/bin/ksh
 
TXTFILE="sourcefile.txt"
#SIDN=4567
cat $TXTFILE | grep -v "#"| while read R1D
do
   echo ${R1D}
done

=========================
Code:
$ ./hello.ksh
: not found[2]:
./hello.ksh[11]: syntax error: 'done' unexpected

=================================
Code:
$ type ksh
ksh is hashed (/usr/bin/ksh)


Last edited by vbe; 09-15-2011 at 02:52 PM.. Reason: use code tags please...
# 2  
Old 09-15-2011
Whats the second and last part supposed to be?
I see nothing wrong with the script (except that dollar sign is enough to display the variable)
# 3  
Old 09-15-2011
just to show what i get as output..

the second part is the error i get when i run the script.
and the third part is to show that ksh path/installed.

I have reinstalled the shell lib under cygwin but still get this stupid error. It even complains abut blank line. as you can see ": not found[2]:" Line is to blank....
# 4  
Old 09-15-2011
Suddenly I wonder: With what editor did you write your script?
# 5  
Old 09-15-2011
I just tested:
Code:
#!/usr/bin/ksh

TXTFILE="203351.txt"
#SIDN=4567
cat $TXTFILE | grep -v "#"| while read R1D
do
   echo $R1D
done

Works fine...
# 6  
Old 09-15-2011
Quote:
Originally Posted by vbe
Suddenly I wonder: With what editor did you write your script?

I used both notepad++ and notepad (windows). both give same error.
# 7  
Old 09-15-2011
Never use notepad (windows)!
Dont you have a vi in your cygwin? Because I was thinking of DOS/UNIX file format...
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Steps to download and install UNIX in windows7 32 bit.

Can anyone tell the steps to download and install unix OS in windows 7 32 bit. I want to install unix and practice commands there. Any version is ok (4 Replies)
Discussion started by: Little
4 Replies

2. Shell Programming and Scripting

cygwin

Do clear command do not work in cygwin.. (4 Replies)
Discussion started by: parthmittal2007
4 Replies

3. Shell Programming and Scripting

opening new instance of cygwin from withing cygwin

I'm using cygwin on win7, What I would like to do is something like this: cygstart cygwin tail -f /foo/test.log | perl -pe 's/error/\e I know I can start a new instance using either of these: mintty -e ... cygstart tail ... But neither of those open in ANSI mode, so I can't do... (0 Replies)
Discussion started by: Validatorian
0 Replies

4. Virtualization and Cloud Computing

sharing between vmware (ubuntu) and windows7

Hi Friends, I have windows7 in my system and I installed vmware having ubuntu OS, I am able to work in both independently. But I want to share some text file from WINDOWS7 to the vmware ubuntu, I tried and able to ping vmware(ubuntu) ipaddress from windows7 and vice-versa. But when... (0 Replies)
Discussion started by: forroughuse
0 Replies

5. UNIX for Dummies Questions & Answers

Samba & Windows7

Hey there, I´m new to unix and unix.com, so thats my first question :) Does anybody know if theres a version of Samba which supports Windows7 without changing the LAN-Manager-Authentification to LM&NTLM-Answers? Hope someone has an answer... greets from Berlin :) (1 Reply)
Discussion started by: Spidi4u
1 Replies

6. UNIX for Dummies Questions & Answers

Anyone else use Cygwin?

I started to gather some stats from our windows servers through the use of cygwin and sshd :) is anyone else doing this sort of thing? interested in some other indicators I should be checking for... thanks, manny the following is only an example of the type of data I am able to... (4 Replies)
Discussion started by: mr_manny
4 Replies

7. Programming

cygwin

hello ... i am new with cygwin ... and i want you to help me. ... First of all, i want to determine the steady state stream function in a 2-D duct using a square mesh by using the finite-difference methodology and i want to simulate it....and i read a lot of information at... (1 Reply)
Discussion started by: mostafamagdy
1 Replies

8. UNIX for Dummies Questions & Answers

cygwin - sh-3.2$ help!

i am completely new to unix and am trying to learn with cygwin. my problem is simple.... when i use the 'man' command, eg 'man cat' id do not know how to get out of the manual!!!? if i type '!' and Return, rather than having just the $ prompt, it has 'sh-3.2$' as a command prompt.... (1 Reply)
Discussion started by: bobby999
1 Replies

9. UNIX for Dummies Questions & Answers

about cygwin

hi everyone. i have a problem on installing binary file in my cygwin. could anyone help me wat command should i use to install it ? thanks a lot (4 Replies)
Discussion started by: wins1982
4 Replies
Login or Register to Ask a Question