public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Unix "script" utility continued... cygwin newbie need a porting expert's help.
@ 2001-06-29 22:11 Perry Dykes
  2001-06-30  6:14 ` Jeff Hu
  0 siblings, 1 reply; 6+ messages in thread
From: Perry Dykes @ 2001-06-29 22:11 UTC (permalink / raw)
  To: cygwin

Ok, I can't give this script thing up. I'm working on it while on
vacation.

a) Why do I want script to work? Many folks have given alternatives, but
I have a pretty hard req for a "Script" like utility:

1) I'm using some NT code that that allows me to launch a bash script,
but I can't feed any stream processing steps, such as:
bash --login scripttorun.bsh parm1 parm2 | tee IwishIcouldDothis.log

2) Also, some folks (at least 3 so far) have reviewed the expect book
and posted a snippet of using expect. While interesting, the major
reason I'm not using that is because it only tracks commands as issued,
not the output each command throws.

b) Where I'm at in the compile of script.c located in util-linux-2.11d:

Corinna's reply stated I could use : Open with O_NOCTTY.

I did this code, attached below, but get the following error.

perry@PERRYT20
/cygdrive/c/dykes/data/wrk/mkwf/activity-work/typescript/util-linux-2.11d/misc-utils

$ gcc -I../lib script.c -o script.exe
script.c: In function `main':
script.c:125: warning: assignment makes pointer from integer without a
cast
/cygdrive/c/DOCUME~1/perry/LOCALS~1/Temp/ccIAem9J.o(.text+0x71c):script.c:
undefined reference to `cfmakeraw'
collect2: ld returned 1 exit status

Assuming I can figure out warning or ignore, the ld error has me
stumped. Is there a cygwin programmer who knows what this means. I'm not
sure how to debug it. I looked through ld man page and other content for
references to cfmakeraw, and so far not sure what this is or how to get
rid of error.

As always your helps is appreciated well in advance.

Regards,
Perry


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* RE: Unix "script" utility continued... cygwin newbie need a porting  expert's help.
  2001-06-29 22:11 Unix "script" utility continued... cygwin newbie need a porting expert's help Perry Dykes
@ 2001-06-30  6:14 ` Jeff Hu
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff Hu @ 2001-06-30  6:14 UTC (permalink / raw)
  To: cygwin

Here's a link to info about cfmakeraw:
http://www.linuxbase.org/spec/gLSB/gLSB/baselib-cfmakeraw-3.html

I gather it's supposed to be defined in termios.h


-----Original Message-----
From: cygwin-owner@sources.redhat.com
[ mailto:cygwin-owner@sources.redhat.com]On Behalf Of Perry Dykes
Sent: Saturday, June 30, 2001 1:16 AM
To: cygwin@cygwin.com
Subject: Re: Unix "script" utility continued... cygwin newbie need a porting
expert's help.

[snip]
I did this code, attached below, but get the following error.

perry@PERRYT20
/cygdrive/c/dykes/data/wrk/mkwf/activity-work/typescript/util-linux-2.11d/mi
sc-utils

$ gcc -I../lib script.c -o script.exe
script.c: In function `main':
script.c:125: warning: assignment makes pointer from integer without a
cast
/cygdrive/c/DOCUME~1/perry/LOCALS~1/Temp/ccIAem9J.o(.text+0x71c):script.c:
undefined reference to `cfmakeraw'
collect2: ld returned 1 exit status

Assuming I can figure out warning or ignore, the ld error has me
stumped. Is there a cygwin programmer who knows what this means. I'm not
sure how to debug it. I looked through ld man page and other content for
references to cfmakeraw, and so far not sure what this is or how to get
rid of error.

As always your helps is appreciated well in advance.

Regards,
Perry


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* RE: Unix "script" utility continued... cygwin newbie need a porting  expert's help.
@ 2001-07-23 10:35 Glen Coakley
  0 siblings, 0 replies; 6+ messages in thread
From: Glen Coakley @ 2001-07-23 10:35 UTC (permalink / raw)
  To: cygwin

I no longer have your original email so I need you to refersh my memory. 
What is your goal in wanting to capture all of the output of the script?
Does it *have* to be in Script format? Is it just for logging of debugging?
Does the following help you?

You can put the following in your script:

#---------- Start of script -------------------
	#!/bin/sh -x
	(
#----------------------------------------------

# Example body of script 

	grep term /this_file_does_not_exist     # will cause output to
stderr
	grep term /usr/include/sys/termios.h    # will cause output to
stdout

#---------- End of script ---------------------
	) > myoutput.lst 2>&1
#----------------------------------------------

All output including the commands issued will end up in 'myoutput.lst'.
This will work for Bourne derivatives (bash, ksh, etc.) also.

________________________________
Glen Coakley, Sr. Software Engineer
MQSoftware Inc., (763) 543-4845
"Tinkero ergo sum." -- Chuck Murcko


> -----Original Message-----
> From: Perry Dykes [ mailto:pdykes@lakes.com ]
> Sent: Saturday, June 30, 2001 12:22 AM
> To: cygwin@cygwin.com
> Subject: Re: Unix "script" utility continued... cygwin newbie need a
> porting expert's help. 
> 
> 
> Whoops, here is the source.
> 
> And here is how I'm compiling:
> 
> gcc -I../lib script.c -o script.exe
> 
> Hoping maybe a better command line parm list to avoid problem in
> previous post.
> 
> Regards,
> Perry
> 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: Unix "script" utility continued... cygwin newbie need a porting expert's help.
@ 2001-06-29 22:18 Perry Dykes
  0 siblings, 0 replies; 6+ messages in thread
From: Perry Dykes @ 2001-06-29 22:18 UTC (permalink / raw)
  To: cygwin

Whoops, here is the source.

And here is how I'm compiling:

gcc -I../lib script.c -o script.exe

Hoping maybe a better command line parm list to avoid problem in
previous post.

Regards,
Perry

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

* Re: Unix "script" utility continued... cygwin newbie need a porting expert's help..
  2001-05-29 19:36 Perry Dykes
@ 2001-05-30  0:00 ` Corinna Vinschen
  0 siblings, 0 replies; 6+ messages in thread
From: Corinna Vinschen @ 2001-05-30  0:00 UTC (permalink / raw)
  To: cygwin

On Tue, May 29, 2001 at 09:40:36PM -0500, Perry Dykes wrote:
> Still working on making a cygwin "script" utility. First, the source,
> found the "script.c" utility in the util-linux rpm. Now attempting to
> port. Got the compilation down to 2 problems, the warning, I can
> address, but the error gcc spits out at line 387 has me stumped. Does
> anyone know if the the following TIOCSCTTY attribute is supported or has
> an alternative value:
> 
>        (void) ioctl(slave, TIOCSCTTY, 0);

Open with O_NOCTTY.

> Here is the compilation output:
> 
> $ gcc -I../lib script.c -o script.exe
> script.c: In function `main':
> script.c:125: warning: assignment makes pointer from integer without a
> cast
> script.c: In function `getslave':
> script.c:387: `TIOCSCTTY' undeclared (first use in this function)
> script.c:387: (Each undeclared identifier is reported only once
> script.c:387: for each function it appears in.)
> 
> The modified source is attached. In the source file, I have been
> avoiding the PTY support, not sure cygwin has that. Advise or where to
> look for info on this would be great.

Cygwin supports streams ptys:

    master = open ("/dev/ptmx", O_RDWR);
    grantpt(master);
    unlockpt(master);
    slave = open (ptsname(master), O_RDWR | O_NOCTTY);   

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

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

* Unix "script" utility continued... cygwin newbie need a porting expert's help..
@ 2001-05-29 19:36 Perry Dykes
  2001-05-30  0:00 ` Corinna Vinschen
  0 siblings, 1 reply; 6+ messages in thread
From: Perry Dykes @ 2001-05-29 19:36 UTC (permalink / raw)
  To: cygwin

Still working on making a cygwin "script" utility. First, the source,
found the "script.c" utility in the util-linux rpm. Now attempting to
port. Got the compilation down to 2 problems, the warning, I can
address, but the error gcc spits out at line 387 has me stumped. Does
anyone know if the the following TIOCSCTTY attribute is supported or has
an alternative value:

       (void) ioctl(slave, TIOCSCTTY, 0);

Here is the compilation output:

$ gcc -I../lib script.c -o script.exe
script.c: In function `main':
script.c:125: warning: assignment makes pointer from integer without a
cast
script.c: In function `getslave':
script.c:387: `TIOCSCTTY' undeclared (first use in this function)
script.c:387: (Each undeclared identifier is reported only once
script.c:387: for each function it appears in.)

The modified source is attached. In the source file, I have been
avoiding the PTY support, not sure cygwin has that. Advise or where to
look for info on this would be great.

Thanks for any help you can offer.

Regards,
Perry




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

end of thread, other threads:[~2001-07-23 10:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-29 22:11 Unix "script" utility continued... cygwin newbie need a porting expert's help Perry Dykes
2001-06-30  6:14 ` Jeff Hu
  -- strict thread matches above, loose matches on Subject: below --
2001-07-23 10:35 Glen Coakley
2001-06-29 22:18 Perry Dykes
2001-05-29 19:36 Perry Dykes
2001-05-30  0:00 ` Corinna Vinschen

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).