Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

awk/nawk(ksh) with windows o/s 1

Status
Not open for further replies.

desanti

Programmer
Jul 9, 2004
51
US
I have used various awk pgms with DOS prompt on my puter.
I was told,after various problems,that perhaps the KSH shell would be a better option.I downloaded same.The blurb said that with win9x it would be slow.it is,but that is o.k. when i try to use KSH i get a dos type screen which says "HOME was set as /home/root - but no such directory.
resetting HOME to /tmp.then $ prompt.what i wish to do is
invoke nawk/awk via command line.my problem is that when i specify the data file,i cannot get it to recognise the input.example:
$ nawk '{print $1,$2}' c:\windows\desktop\datafile
the pgm says "cant find file:c:windowsdesktopdatafile"(and that is exactly how it prints out).also,i am unable to interrupt pgm or use quit.My insert and delete won't work.also,I WAS a programmer,support person, but primarily
main frames.I was with AT&T and used UNIX(sparingly).
I last worked with unix in 1975 and i cannot remember much.
any help will be appreciated. P.S.all the above works with
my original downloaded pgm's using a DOS prompt.thank you
 
Try forward slashes / instead of back slashes \.

CaKiwi
 
Instead of this:
$ nawk '{print $1,$2}' c:\windows\desktop\datafile
have you tried this ?
$ nawk '{print $1,$2}' c:\\windows\\desktop\\datafile
or this ?
$ nawk '{print $1,$2}' c:/windows/desktop/datafile
or this ?
$ nawk '{print $1,$2}' /windows/desktop/datafile

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top