🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.unix.shell
4 messages
4 total messages Started by hao zhou Sun, 28 Oct 1990 05:24
typescript and ^M
#1642
Author: hao zhou
Date: Sun, 28 Oct 1990 05:24
12 lines
832 bytes
Maybe this question was asked before ...

Anyway I wonder if there is any filter I can use to get rid of ^M
(RETURN) in the typescript file. One way I can do it is to replace all
^M with null in emacs or vi. Is there any better way of doing this? In
other words, is it possible to create a typescript without CR chars?

	Thanks ... HaoZ

-- 
Internet:haozhou@acsu.buffalo.edu BITNET:haozhou%acsu.buffalo.edu@UBVM.BITNET
UUCP: uunet!acsu.buffalo.edu!haozhou
Re: typescript and ^M
#1653
Author: John P. Kole
Date: Sun, 28 Oct 1990 15:43
67 lines
2612 bytes
In article <42995@eerie.acsu.Buffalo.EDU> haozhou@acsu.buffalo.edu (hao zhou) writes:
>Anyway I wonder if there is any filter I can use to get rid of ^M
>(RETURN) in the typescript file. One way I can do it is to replace all
>^M with null in emacs or vi. Is there any better way of doing this? In
>other words, is it possible to create a typescript without CR chars?

The are other annoying characters in typescript files besides ^M.
Here is a script I use to remove most of them from csh typescript
files (I believe that tcsh puts different annoying characters).

I just type 'fixcshscript' and it defaults to typescript.  You must
redirect stdout to the new file.

The ^M is removed via 'tr' within the csh script 'fixcshscript'.
All others, including ones you may want to add, are done via the sed
script fixcshscript.sed which is invoked from fixcshscript after the
^M are removed.

Happy scripting,
jpkole

----File: fixcshscript----cut here----
#!/bin/csh -f
#-----------------------------------------------------------------------
# FILE:		fixcshscript
# AUTHOR:	John P. Kole
# DESCRIPTION:	Script used to clean up a typescript file from csh.
#		Outputs to stdout.
# EXAMPLE: 	% script
#		...session being recorded...
#		% exit
#		% fixcshscript typescript
#			- or -
#		% fixcshscript (defaults to typescript)
#-----------------------------------------------------------------------
set dir  = `whence $0`
set sedf = $dir:h/fixcshscript.sed

if ($#argv == 0) then
	set script = typescript
else if ($#argv == 1) then
	set script = $1
else
	set pgm = $0
	echo "usage: $pgm:t [ script-file ]"
	exit 1
endif

tr -d '\015' < $script | sed -f $sedf

#[The End]#
----End of fixcshscript----cut here----
----File: fixcshscript.sed----cut here----
#-----------------------------------------------------------------------
# FILE:		fixcshscript.sed
# AUTHOR:	John P. Kole
# DESCRIPTION:	Sed script used to clean up a typescript file from csh.
# EXAMPLE: 	% script
#		...session being recorded...
#		% sed -f fixcshscript.sed typescript
#-----------------------------------------------------------------------
s/ //g
:again
s/[^]//g
t again
#[The End]#
----End of fixcshscript.sed----cut here----
Re: typescript and ^M
#1649
Author: Mark Sicignano
Date: Sun, 28 Oct 1990 18:14
13 lines
871 bytes
In article <42995@eerie.acsu.Buffalo.EDU> haozhou@acsu.buffalo.edu (hao zhou) writes:
>Anyway I wonder if there is any filter I can use to get rid of ^M
>(RETURN) in the typescript file. One way I can do it is to replace all
>^M with null in emacs or vi. Is there any better way of doing this? In

tr -d '\015' < typescript > newfile

works for me.

-mark
-- 
Mark Sicignano                                  ...!uunet!hsi!mark
3M Health Information Systems                   mark@hsi.com
Re: typescript and ^M (In vi)
#1667
Author: Jeff Beadles
Date: Mon, 29 Oct 1990 14:13
21 lines
1094 bytes
In <42995@eerie.acsu.Buffalo.EDU> haozhou@acsu.buffalo.edu (hao zhou) writes:
>Maybe this question was asked before ...

It has.  Maybe it's time to add to a faq...

>Anyway I wonder if there is any filter I can use to get rid of ^M
>(RETURN) in the typescript file. One way I can do it is to replace all
>^M with null in emacs or vi. Is there any better way of doing this? In
>other words, is it possible to create a typescript without CR chars?

No, typescript files will have ^M, as it's in the data stream...

Anyway, to remove them within vi, type:

	<ESCAPE>:%s/^V^M$//

(escape colon percent s slash control-v control-m dollar slash slash)

	-Jeff
-- 
Jeff Beadles		jeff@onion.pdx.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads