public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* PS and AWK Linux Commands on Cygwin
       [not found] <1278249779.9195574.1470314208273.JavaMail.yahoo.ref@mail.yahoo.com>
@ 2016-08-04 13:12 ` Scott Geiger
  2016-08-04 13:23   ` Eliot Moss
  0 siblings, 1 reply; 8+ messages in thread
From: Scott Geiger @ 2016-08-04 13:12 UTC (permalink / raw)
  To: cygwin

Hello,

We just started using Cygwin to assist us with running various scripts and commands in an Oracle E-Business Suite environment on a Windows 2008 R2 server.  We have a script that we run that does the following:

ps -ef | grep mwa | grep -v grep | awk '{print $2}' | xargs kill -9

On Cygwin, however, I receive an error that says:

"'awk' is not recognized as an internal or external command,
operable program or batch file."

The other command that I often run to check if there are any processes running for our MWA server is this:

ps -ef | grep mwa

When I run this command using Cygwin, it returns nothing.   

When I run this command using MKSTookkit, I see something like this:   Which is a list of processes running that contain the letters "mwa"

  oaprod  13696   9592  0 22:35:25 con  0:00 C:\Windows\system32\cmd.exe  /K h:\oracle\prod\inst\app
s\OAPPSP_wpaora\admin\scripts\mwactl.cmd  -mwatop h:\oracle\prod\inst\apps\OAPPSP_wpaora start 10200

  oaprod   6716   9592  0 22:35:25 con  0:00 C:\Windows\system32\cmd.exe  /K h:\oracle\prod\inst\app
s\OAPPSP_wpaora\admin\scripts\mwactl.cmd  -mwatop h:\oracle\prod\inst\apps\OAPPSP_wpaora start 10202

  oaprod   5916   9592  0 22:35:25 con  0:00 C:\Windows\system32\cmd.exe  /K h:\oracle\prod\inst\app
s\OAPPSP_wpaora\admin\scripts\mwactl.cmd  -mwatop h:\oracle\prod\inst\apps\OAPPSP_wpaora start 10204

oaprod  14192   6716  0 22:35:25 con  0:10 h:\oracle\prod\apps\tech_st\10.1.3\appsutil\jdk\bin\jav
a.exe  -Doracle.apps.mwa=h:\oracle\prod\inst\apps\OAPPSP_wpaora -Doracle.apps.inst=h:\oracle\prod\in
st\apps\OAPPSP_wpaora -Doracle.apps.jrad.mmd=h:\oracle\prod\apps\apps_st\comn\webapps\oacore\html\jr
ad -mx1024m -ms256m  -cp "h:\oracle\prod\apps\tech_st\10.1.3\appsutil\jdk\lib\dt.jar;h:\oracle\prod\
apps\tech_st\10.1.3\appsutil\jdk\lib\tools.jar;h:\oracle\prod\apps\tech_st\10.1.3\appsutil\jdk\jre\l
ib\rt.jar;h:\oracle\prod\apps\apps_st\comn\java\lib\apps
oaprod  10788   9592  0 22:35:26 con  0:00 h:\oracle\prod\apps\apps_st\appl\mwa\12.0.0\bin\MWADIS.
exe

I am not the person who installed Cygwin on our Windows server, so I cannot determine if it was installed correctly.

Can you please tell me if the above commands should work with Cygwin or perhaps a better suggestion to obtain similar information using a different command in Cygwin?

Thank you,
SG

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PS and AWK Linux Commands on Cygwin
  2016-08-04 13:12 ` PS and AWK Linux Commands on Cygwin Scott Geiger
@ 2016-08-04 13:23   ` Eliot Moss
  2016-08-04 13:30     ` Mark Hansen
  0 siblings, 1 reply; 8+ messages in thread
From: Eliot Moss @ 2016-08-04 13:23 UTC (permalink / raw)
  To: cygwin

So, a couple of things ...

Cygwin definitely supports gawk - I use it all the time.
My system has a link from awk to gawk, so awk will work.
I can't recall if I added that link or if it came with
the installation.  awk may be in a separate package
that you'll have to install from the Cygwin package
installer.

As for ps, it works, but it will show only Cygwin
related processes.  It may have other limitations
as well, because it might be impossible or very
difficult to support some POSIX features under
Windows.

Regards - Eliot Moss

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PS and AWK Linux Commands on Cygwin
  2016-08-04 13:23   ` Eliot Moss
@ 2016-08-04 13:30     ` Mark Hansen
  2016-08-04 13:55       ` Eliot Moss
  2016-08-04 14:35       ` Scott Geiger
  0 siblings, 2 replies; 8+ messages in thread
From: Mark Hansen @ 2016-08-04 13:30 UTC (permalink / raw)
  To: cygwin

On 8/4/2016 6:12 AM, Eliot Moss wrote:
> So, a couple of things ...
>
> Cygwin definitely supports gawk - I use it all the time.
> My system has a link from awk to gawk, so awk will work.
> I can't recall if I added that link or if it came with
> the installation.  awk may be in a separate package
> that you'll have to install from the Cygwin package
> installer.

I have a fresh installation of Cygwin and /usr/bin/awk is a link to /usr/bin/gawk - FYI

>
> As for ps, it works, but it will show only Cygwin
> related processes.  It may have other limitations
> as well, because it might be impossible or very
> difficult to support some POSIX features under
> Windows.

Cygwin ps allows for a -W command-line argument which tells it to include all windows processes.
There are other arguments like -l for "long" mode, -f for "full" mode, etc.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PS and AWK Linux Commands on Cygwin
  2016-08-04 13:30     ` Mark Hansen
@ 2016-08-04 13:55       ` Eliot Moss
  2016-08-04 14:35       ` Scott Geiger
  1 sibling, 0 replies; 8+ messages in thread
From: Eliot Moss @ 2016-08-04 13:55 UTC (permalink / raw)
  To: cygwin

On 8/4/2016 9:20 AM, Mark Hansen wrote:
> On 8/4/2016 6:12 AM, Eliot Moss wrote:
>> So, a couple of things ...
>>
>> Cygwin definitely supports gawk - I use it all the time.
>> My system has a link from awk to gawk, so awk will work.
>> I can't recall if I added that link or if it came with
>> the installation.  awk may be in a separate package
>> that you'll have to install from the Cygwin package
>> installer.
>
> I have a fresh installation of Cygwin and /usr/bin/awk is a link to /usr/bin/gawk - FYI
>
>>
>> As for ps, it works, but it will show only Cygwin
>> related processes.  It may have other limitations
>> as well, because it might be impossible or very
>> difficult to support some POSIX features under
>> Windows.
>
> Cygwin ps allows for a -W command-line argument which tells it to include all windows processes.
> There are other arguments like -l for "long" mode, -f for "full" mode, etc.

Thanks for the additional info!

On Windows, procps is useful, but of course it's Windows-specific ...

Regards - EM

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PS and AWK Linux Commands on Cygwin
  2016-08-04 13:30     ` Mark Hansen
  2016-08-04 13:55       ` Eliot Moss
@ 2016-08-04 14:35       ` Scott Geiger
  2016-08-04 18:31         ` Andrey Repin
  2016-08-05  9:31         ` Mark Hansen
  1 sibling, 2 replies; 8+ messages in thread
From: Scott Geiger @ 2016-08-04 14:35 UTC (permalink / raw)
  To: Mark Hansen, cygwin

Thanks, this was helpful.  When I use -W I get one process that contains the uppercase value that I entered through the grep command but not the lowercase processes.

Is there a parameter to ignore case?


On Thursday, August 4, 2016 9:27 AM, Mark Hansen <meh@winfirst.com> wrote:
On 8/4/2016 6:12 AM, Eliot Moss wrote:
> So, a couple of things ...
>
> Cygwin definitely supports gawk - I use it all the time.
> My system has a link from awk to gawk, so awk will work.
> I can't recall if I added that link or if it came with
> the installation.  awk may be in a separate package
> that you'll have to install from the Cygwin package
> installer.

I have a fresh installation of Cygwin and /usr/bin/awk is a link to /usr/bin/gawk - FYI

>
> As for ps, it works, but it will show only Cygwin
> related processes.  It may have other limitations
> as well, because it might be impossible or very
> difficult to support some POSIX features under
> Windows.

Cygwin ps allows for a -W command-line argument which tells it to include all windows processes.
There are other arguments like -l for "long" mode, -f for "full" mode, etc.



--
Problem reports:      http://cygwin.com/problems.html
FAQ:                  http://cygwin.com/faq/
Documentation:        http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PS and AWK Linux Commands on Cygwin
  2016-08-04 14:35       ` Scott Geiger
@ 2016-08-04 18:31         ` Andrey Repin
  2016-08-05  9:31         ` Mark Hansen
  1 sibling, 0 replies; 8+ messages in thread
From: Andrey Repin @ 2016-08-04 18:31 UTC (permalink / raw)
  To: Scott Geiger, cygwin

Greetings, Scott Geiger!

> Thanks, this was helpful.  When I use -W I get one process that contains
> the uppercase value that I entered through the grep command but not the lowercase processes.

> Is there a parameter to ignore case?

Use tasklist.

P.S.
And don't top-post. Please.


-- 
With best regards,
Andrey Repin
Thursday, August 4, 2016 17:43:08

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PS and AWK Linux Commands on Cygwin
  2016-08-04 14:35       ` Scott Geiger
  2016-08-04 18:31         ` Andrey Repin
@ 2016-08-05  9:31         ` Mark Hansen
  2016-08-05 14:57           ` cyg Simple
  1 sibling, 1 reply; 8+ messages in thread
From: Mark Hansen @ 2016-08-05  9:31 UTC (permalink / raw)
  To: cygwin

On 8/4/2016 6:30 AM, Scott Geiger wrote:
> Thanks, this was helpful.  When I use -W I get one process that contains the uppercase value that I entered through the grep command but not the lowercase processes.
>
> Is there a parameter to ignore case?

Are you asking if there is a parameter to grep to get it to ignore case?
Have you checked the man page for grep?

http://lmgtfy.com/?q=man+grep

>
>
> On Thursday, August 4, 2016 9:27 AM, Mark Hansen <meh@winfirst.com> wrote:
> On 8/4/2016 6:12 AM, Eliot Moss wrote:
>> So, a couple of things ...
>>
>> Cygwin definitely supports gawk - I use it all the time.
>> My system has a link from awk to gawk, so awk will work.
>> I can't recall if I added that link or if it came with
>> the installation.  awk may be in a separate package
>> that you'll have to install from the Cygwin package
>> installer.
>
> I have a fresh installation of Cygwin and /usr/bin/awk is a link to /usr/bin/gawk - FYI
>
>>
>> As for ps, it works, but it will show only Cygwin
>> related processes.  It may have other limitations
>> as well, because it might be impossible or very
>> difficult to support some POSIX features under
>> Windows.
>
> Cygwin ps allows for a -W command-line argument which tells it to include all windows processes.
> There are other arguments like -l for "long" mode, -f for "full" mode, etc.
>
>
>
> --
> Problem reports:      http://cygwin.com/problems.html
> FAQ:                  http://cygwin.com/faq/
> Documentation:        http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PS and AWK Linux Commands on Cygwin
  2016-08-05  9:31         ` Mark Hansen
@ 2016-08-05 14:57           ` cyg Simple
  0 siblings, 0 replies; 8+ messages in thread
From: cyg Simple @ 2016-08-05 14:57 UTC (permalink / raw)
  To: cygwin

On 8/4/2016 7:01 PM, Mark Hansen wrote:
> On 8/4/2016 6:30 AM, Scott Geiger wrote:
>> Thanks, this was helpful.  When I use -W I get one process that
>> contains the uppercase value that I entered through the grep command
>> but not the lowercase processes.
>>
>> Is there a parameter to ignore case?
> 
> Are you asking if there is a parameter to grep to get it to ignore case?
> Have you checked the man page for grep?
> 
> http://lmgtfy.com/?q=man+grep
> 

Or you can use 'grep --help' to find it.  Or use intuition and guess
what the option might be, it's quite obvious.

-- 
cyg Simple

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-08-05 14:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1278249779.9195574.1470314208273.JavaMail.yahoo.ref@mail.yahoo.com>
2016-08-04 13:12 ` PS and AWK Linux Commands on Cygwin Scott Geiger
2016-08-04 13:23   ` Eliot Moss
2016-08-04 13:30     ` Mark Hansen
2016-08-04 13:55       ` Eliot Moss
2016-08-04 14:35       ` Scott Geiger
2016-08-04 18:31         ` Andrey Repin
2016-08-05  9:31         ` Mark Hansen
2016-08-05 14:57           ` cyg Simple

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).